This commit is contained in:
pennyrigate 2023-01-18 16:22:45 -05:00
commit 49fd274302
7 changed files with 167 additions and 12 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
.import/ .import/
build/

77
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,77 @@
image: barichello/godot-ci:3.5.1
stages:
- export
- deploy
# keep imported assets between builds
cache:
key: imported-assets
paths:
- .import/
variables:
EXPORT_NAME: hero-mark-2
windows:
stage: export
rules:
- if: $CI_COMMIT_TAG
script:
- mkdir -v -p build/windows
- godot -v --export "windows" build/windows/$EXPORT_NAME.exe
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
- build/windows
linux:
stage: export
rules:
- if: $CI_COMMIT_TAG
script:
- mkdir -v -p build/linux
- godot -v --export "linux" build/linux/$EXPORT_NAME.x86_64
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
- build/linux
html5:
stage: export
rules:
- if: $CI_COMMIT_TAG
script:
- mkdir -v -p build/html5
- godot -v --export "html5" build/html5/index.html
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
- build/html5
itchio:windows:
stage: deploy
dependencies:
- linux
rules:
- if: $CI_COMMIT_TAG
script:
- butler push ./build/windows $ITCHIO_USERNAME/$ITCHIO_GAME:windows-beta --userversion $CI_COMMIT_TAG
itchio:linux:
stage: deploy
dependencies:
- linux
rules:
- if: $CI_COMMIT_TAG
script:
- butler push ./build/linux $ITCHIO_USERNAME/$ITCHIO_GAME:linux-beta --userversion $CI_COMMIT_TAG
itchio:html5:
stage: deploy
dependencies:
- html5
rules:
- if: $CI_COMMIT_TAG
script:
- butler push ./build/html5 $ITCHIO_USERNAME/$ITCHIO_GAME:html5-beta --userversion $CI_COMMIT_TAG

BIN
audio/sounds/gover.wav Normal file

Binary file not shown.

View file

@ -0,0 +1,23 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/gover.wav-fb994db7cb276d7598aad5c659b45fb3.sample"
[deps]
source_file="res://audio/sounds/gover.wav"
dest_files=[ "res://.import/gover.wav-fb994db7cb276d7598aad5c659b45fb3.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

View file

@ -1,13 +1,13 @@
[preset.0] [preset.0]
name="Windows Desktop" name="windows"
platform="Windows Desktop" platform="Windows Desktop"
runnable=true runnable=true
custom_features="" custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../output/test_build.exe" export_path="build/windows/Hero Mark 2.exe"
script_export_mode=1 script_export_mode=1
script_encryption_key="" script_encryption_key=""
@ -31,7 +31,7 @@ codesign/timestamp_server_url=""
codesign/digest_algorithm=1 codesign/digest_algorithm=1
codesign/description="" codesign/description=""
codesign/custom_options=PoolStringArray( ) codesign/custom_options=PoolStringArray( )
application/modify_resources=true application/modify_resources=false
application/icon="" application/icon=""
application/file_version="" application/file_version=""
application/product_version="" application/product_version=""
@ -43,14 +43,14 @@ application/trademarks=""
[preset.1] [preset.1]
name="Linux/X11" name="linux"
platform="Linux/X11" platform="Linux/X11"
runnable=true runnable=true
custom_features="" custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../output/hero mark 2_lin.x86_64" export_path="build/linux/Hero Mark 2.x86_64"
script_export_mode=1 script_export_mode=1
script_encryption_key="" script_encryption_key=""
@ -65,3 +65,38 @@ texture_format/s3tc=true
texture_format/etc=false texture_format/etc=false
texture_format/etc2=false texture_format/etc2=false
texture_format/no_bptc_fallbacks=true texture_format/no_bptc_fallbacks=true
[preset.2]
name="html5"
platform="HTML5"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="build/html5/index.html"
script_export_mode=1
script_encryption_key=""
[preset.2.options]
custom_template/debug=""
custom_template/release=""
variant/export_type=1
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/export_icon=true
html/custom_html_shell=""
html/head_include=""
html/canvas_resize_policy=2
html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=false
progressive_web_app/enabled=false
progressive_web_app/offline_page=""
progressive_web_app/display=1
progressive_web_app/orientation=0
progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color( 0, 0, 0, 1 )

View file

@ -34,6 +34,7 @@ const a_sword = preload("res://audio/sounds/sword.ogg")
const a_doublejump = preload("res://audio/sounds/a_bree.wav") const a_doublejump = preload("res://audio/sounds/a_bree.wav")
const a_shoot = preload("res://audio/sounds/a_egg_shoot.ogg") const a_shoot = preload("res://audio/sounds/a_egg_shoot.ogg")
const a_die = preload("res://audio/sounds/die.wav") const a_die = preload("res://audio/sounds/die.wav")
const a_gover = preload("res://audio/sounds/gover.wav")
#Objects #Objects
const block_text = preload("res://objects/hud/blocktext.tscn") const block_text = preload("res://objects/hud/blocktext.tscn")
const pause_screen = preload("res://objects/hud/pause_screen.tscn") const pause_screen = preload("res://objects/hud/pause_screen.tscn")
@ -118,6 +119,10 @@ func restart_level():
Game.arrows = 0 Game.arrows = 0
Game.lives = 2 Game.lives = 2
Game.ac_climb.stop() Game.ac_climb.stop()
Game.ac_die.stop()
Engine.time_scale = 1.0
for tween in get_tree().get_processed_tweens():
tween.kill()
Game.change_map(load(Game.get_map().filename)) Game.change_map(load(Game.get_map().filename))
#Freeze frame #Freeze frame

View file

@ -12,7 +12,7 @@ onready var dust_particles = $DustParticles
#Map #Map
onready var map = get_owner() onready var map = get_owner()
##States ##States
enum State {IDLE,WALK,JUMP,FALL,STUNNED,CLIMB,SWORD,SHOOT} enum State {IDLE,WALK,JUMP,FALL,STUNNED,CLIMB,SWORD,SHOOT,INACTIVE}
var current_state = State.IDLE var current_state = State.IDLE
##Runtime ##Runtime
var axis = Vector2.ZERO #Current direction being held var axis = Vector2.ZERO #Current direction being held
@ -41,6 +41,8 @@ func _physics_process(delta):
#Check ladder #Check ladder
check_ladder() check_ladder()
match current_state: match current_state:
State.INACTIVE:
return
State.IDLE: State.IDLE:
_process_idle() _process_idle()
continue continue
@ -69,7 +71,8 @@ func _physics_process(delta):
_process_shoot() _process_shoot()
#Gravity #Gravity
if current_state != State.CLIMB: velocity.y += gravity if current_state != State.CLIMB:
velocity.y += gravity
#Cut y velocity when hitting ceiling #Cut y velocity when hitting ceiling
if is_on_ceiling(): if is_on_ceiling():
current_state = State.FALL current_state = State.FALL
@ -251,14 +254,25 @@ func die():
new_particles.global_position = global_position new_particles.global_position = global_position
new_particles.emitting = true new_particles.emitting = true
sprite.visible = false sprite.visible = false
Game.play_sound(Game.a_die,Game.ac_die)
yield(Game.freeze_frame(0.3), "timeout")
position = Game.respawn_point
sprite.visible = true
current_state = State.IDLE
Game.lives -= 1 Game.lives -= 1
if Game.lives < 0: if Game.lives < 0:
new_particles.amount = 64
new_particles.lifetime = 0.45
new_particles.speed_scale = 1.5
current_state = State.INACTIVE
Game.play_sound(Game.a_gover, Game.ac_die)
var time_tween = get_tree().create_tween()
time_tween.tween_property(Engine, "time_scale", 0.1, 0.3)
Game.ac_music.stop()
yield(time_tween, "finished")
yield(get_tree().create_timer(1.0 * 0.1), "timeout")
Game.call_deferred("restart_level") Game.call_deferred("restart_level")
else:
Game.play_sound(Game.a_die, Game.ac_die)
yield(Game.freeze_frame(0.3), "timeout")
position = Game.respawn_point
current_state = State.IDLE
sprite.visible = true
func _on_AnimationPlayer_animation_finished(anim_name): func _on_AnimationPlayer_animation_finished(anim_name):
#Return to idle after slash #Return to idle after slash