2022 demo
This commit is contained in:
parent
c60375cb98
commit
4727fb0f55
41 changed files with 761 additions and 68 deletions
3
.import/a_hurt.ogg-a562e9409cf963b74445d6ea13ce9354.md5
Normal file
3
.import/a_hurt.ogg-a562e9409cf963b74445d6ea13ce9354.md5
Normal file
|
@ -0,0 +1,3 @@
|
|||
source_md5="0837cb6ec551daab4fa5f117ec3033f4"
|
||||
dest_md5="42ebf02c3d91547961debd02d9710063"
|
||||
|
BIN
.import/a_hurt.ogg-a562e9409cf963b74445d6ea13ce9354.oggstr
Normal file
BIN
.import/a_hurt.ogg-a562e9409cf963b74445d6ea13ce9354.oggstr
Normal file
Binary file not shown.
3
.import/exit.png-5434234d068c5cc7b377eff51dc629c9.md5
Normal file
3
.import/exit.png-5434234d068c5cc7b377eff51dc629c9.md5
Normal file
|
@ -0,0 +1,3 @@
|
|||
source_md5="53eae53c845ca81da656334b40f6ed43"
|
||||
dest_md5="0a529cf5ba7482e509a961ed81c55abd"
|
||||
|
BIN
.import/exit.png-5434234d068c5cc7b377eff51dc629c9.stex
Normal file
BIN
.import/exit.png-5434234d068c5cc7b377eff51dc629c9.stex
Normal file
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
source_md5="0057c515a9b9d7768894647b74c442d5"
|
||||
dest_md5="be2b65eec0ac8ff7e78507d4877e826c"
|
||||
|
BIN
.import/rumble_loop.mp3-8296079a496312740d286c71cb69f818.mp3str
Normal file
BIN
.import/rumble_loop.mp3-8296079a496312740d286c71cb69f818.mp3str
Normal file
Binary file not shown.
3
.import/spike.png-a608aa67f6e0f5dc30513729727656ff.md5
Normal file
3
.import/spike.png-a608aa67f6e0f5dc30513729727656ff.md5
Normal file
|
@ -0,0 +1,3 @@
|
|||
source_md5="a600e425906c5df72955d9359438f454"
|
||||
dest_md5="38480d5a86d4c34138941ec5c6cb2261"
|
||||
|
BIN
.import/spike.png-a608aa67f6e0f5dc30513729727656ff.stex
Normal file
BIN
.import/spike.png-a608aa67f6e0f5dc30513729727656ff.stex
Normal file
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
source_md5="9411656496cf29e49efeb3416b7f0766"
|
||||
dest_md5="c373833324a7add86a57455f2d1f93b0"
|
||||
|
BIN
.import/water_bottom.png-e393cffcc7d5d462a9452f73af8184eb.stex
Normal file
BIN
.import/water_bottom.png-e393cffcc7d5d462a9452f73af8184eb.stex
Normal file
Binary file not shown.
BIN
audio/music/rumble_loop.mp3
Normal file
BIN
audio/music/rumble_loop.mp3
Normal file
Binary file not shown.
15
audio/music/rumble_loop.mp3.import
Normal file
15
audio/music/rumble_loop.mp3.import
Normal file
|
@ -0,0 +1,15 @@
|
|||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
path="res://.import/rumble_loop.mp3-8296079a496312740d286c71cb69f818.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/music/rumble_loop.mp3"
|
||||
dest_files=[ "res://.import/rumble_loop.mp3-8296079a496312740d286c71cb69f818.mp3str" ]
|
||||
|
||||
[params]
|
||||
|
||||
loop=true
|
||||
loop_offset=0
|
BIN
audio/sounds/a_hurt.ogg
Normal file
BIN
audio/sounds/a_hurt.ogg
Normal file
Binary file not shown.
15
audio/sounds/a_hurt.ogg.import
Normal file
15
audio/sounds/a_hurt.ogg.import
Normal file
|
@ -0,0 +1,15 @@
|
|||
[remap]
|
||||
|
||||
importer="ogg_vorbis"
|
||||
type="AudioStreamOGGVorbis"
|
||||
path="res://.import/a_hurt.ogg-a562e9409cf963b74445d6ea13ce9354.oggstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/sounds/a_hurt.ogg"
|
||||
dest_files=[ "res://.import/a_hurt.ogg-a562e9409cf963b74445d6ea13ce9354.oggstr" ]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
|
@ -7,7 +7,7 @@ custom_features=""
|
|||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="../output/test_build.exe"
|
||||
export_path="../demos/Hero Mark 2 2022 Demo/hero mark 2_win.exe"
|
||||
script_export_mode=1
|
||||
script_encryption_key=""
|
||||
|
||||
|
@ -40,3 +40,28 @@ application/product_name=""
|
|||
application/file_description=""
|
||||
application/copyright=""
|
||||
application/trademarks=""
|
||||
|
||||
[preset.1]
|
||||
|
||||
name="Linux/X11"
|
||||
platform="Linux/X11"
|
||||
runnable=true
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="../demos/Hero Mark 2 2022 Demo/lin/hero mark 2_lin.x86_64"
|
||||
script_export_mode=1
|
||||
script_encryption_key=""
|
||||
|
||||
[preset.1.options]
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
binary_format/64_bits=true
|
||||
binary_format/embed_pck=false
|
||||
texture_format/bptc=false
|
||||
texture_format/s3tc=true
|
||||
texture_format/etc=false
|
||||
texture_format/etc2=false
|
||||
texture_format/no_bptc_fallbacks=true
|
||||
|
|
40
game.gd
40
game.gd
|
@ -1,7 +1,9 @@
|
|||
extends Node
|
||||
|
||||
var resolution = Vector2(256,192)
|
||||
onready var viewport = get_parent().get_node("Main/Control/ViewportContainer/Viewport")
|
||||
var current_sector = Vector2(0,0)
|
||||
var fullscreen = false
|
||||
#Onreadys
|
||||
onready var viewport_container = get_parent().get_node("Main/Control/ViewportContainer")
|
||||
#Collectibles
|
||||
|
@ -10,10 +12,14 @@ var stars = [false,false,false,false,false]
|
|||
var shards = 0
|
||||
var arrows = 0
|
||||
var score = 0
|
||||
var high_score = 0
|
||||
var lives = 2
|
||||
#Audio Channels
|
||||
onready var ac_jump = $JumpSound
|
||||
onready var ac_collectible = $CollecitbleSound
|
||||
onready var ac_climb = $ClimbSound
|
||||
onready var ac_die = $DieSound
|
||||
onready var ac_music = $Music
|
||||
#Sounds
|
||||
onready var a_gold = preload("res://audio/sounds/snd_coin.ogg")
|
||||
onready var a_arrow = preload("res://audio/sounds/a_egg_collect.ogg")
|
||||
|
@ -25,8 +31,11 @@ onready var a_climb_down = preload("res://audio/sounds/a_bmilc.ogg")
|
|||
onready var a_sword = preload("res://audio/sounds/sword.ogg")
|
||||
onready var a_doublejump = preload("res://audio/sounds/a_bree.wav")
|
||||
onready var a_shoot = preload("res://audio/sounds/a_egg_shoot.ogg")
|
||||
onready var a_die = preload("res://audio/sounds/a_hurt.ogg")
|
||||
#Objects
|
||||
onready var block_text = preload("res://objects/hud/blocktext.tscn")
|
||||
#Respawn point
|
||||
var respawn_point = Vector2(32,166)
|
||||
|
||||
#Instances a node
|
||||
func instance_node(node:PackedScene,x:float,y:float,parent):
|
||||
|
@ -43,10 +52,35 @@ func play_sound(snd,player):
|
|||
func get_sector(pos):
|
||||
return (pos / resolution).floor()
|
||||
|
||||
#Return the current Map
|
||||
func get_map():
|
||||
return viewport.get_children()[0]
|
||||
|
||||
#Go to new map
|
||||
func change_map(map):
|
||||
get_map().queue_free()
|
||||
instance_node(map,0,0,viewport)
|
||||
|
||||
func _process(delta):
|
||||
#Restart scene
|
||||
if Input.is_action_just_pressed("debug_restart"):
|
||||
get_tree().reload_current_scene()
|
||||
#CRT FILTER
|
||||
if Input.is_action_just_pressed("crt"):
|
||||
viewport_container.material.set_shader_param("enabled",!viewport_container.material.get_shader_param("enabled"))
|
||||
#Restart scene
|
||||
if Input.is_action_just_pressed("debug_restart"):
|
||||
if Game.score > Game.high_score: Game.high_score = Game.score
|
||||
Game.score = 0
|
||||
Game.golds = 0
|
||||
Game.stars = [false,false,false,false,false]
|
||||
Game.shards = 0
|
||||
Game.arrows = 0
|
||||
Game.lives = 2
|
||||
Game.ac_climb.stop()
|
||||
get_tree().reload_current_scene()
|
||||
#Fullscreen
|
||||
if Input.is_action_just_pressed("fullscreen"):
|
||||
print(fullscreen)
|
||||
fullscreen = !fullscreen
|
||||
if fullscreen:
|
||||
OS.set_window_fullscreen(true)
|
||||
else:
|
||||
OS.set_window_fullscreen(false)
|
||||
|
|
|
@ -13,3 +13,9 @@ volume_db = -12.0
|
|||
|
||||
[node name="ClimbSound" type="AudioStreamPlayer" parent="."]
|
||||
volume_db = -12.0
|
||||
|
||||
[node name="Music" type="AudioStreamPlayer" parent="."]
|
||||
volume_db = -13.5
|
||||
|
||||
[node name="DieSound" type="AudioStreamPlayer" parent="."]
|
||||
volume_db = -12.0
|
||||
|
|
BIN
graphics/exit/exit.png
Normal file
BIN
graphics/exit/exit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 260 B |
35
graphics/exit/exit.png.import
Normal file
35
graphics/exit/exit.png.import
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/exit.png-5434234d068c5cc7b377eff51dc629c9.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/exit/exit.png"
|
||||
dest_files=[ "res://.import/exit.png-5434234d068c5cc7b377eff51dc629c9.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
graphics/tiles/spike.png
Normal file
BIN
graphics/tiles/spike.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 181 B |
35
graphics/tiles/spike.png.import
Normal file
35
graphics/tiles/spike.png.import
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/spike.png-a608aa67f6e0f5dc30513729727656ff.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/tiles/spike.png"
|
||||
dest_files=[ "res://.import/spike.png-a608aa67f6e0f5dc30513729727656ff.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
graphics/tiles/water_bottom.png
Normal file
BIN
graphics/tiles/water_bottom.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 131 B |
35
graphics/tiles/water_bottom.png.import
Normal file
35
graphics/tiles/water_bottom.png.import
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/water_bottom.png-e393cffcc7d5d462a9452f73af8184eb.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/tiles/water_bottom.png"
|
||||
dest_files=[ "res://.import/water_bottom.png-e393cffcc7d5d462a9452f73af8184eb.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
4
maps/demo_end.gd
Normal file
4
maps/demo_end.gd
Normal file
|
@ -0,0 +1,4 @@
|
|||
extends Node2D
|
||||
|
||||
func _ready():
|
||||
$Score.text = str(Game.high_score)
|
30
maps/demo_end.tscn
Normal file
30
maps/demo_end.tscn
Normal file
|
@ -0,0 +1,30 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://maps/demo_end.gd" type="Script" id=1]
|
||||
|
||||
[node name="DemoEnd" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
margin_right = 259.0
|
||||
margin_bottom = 196.0
|
||||
color = Color( 0, 0, 0, 1 )
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
margin_left = 13.0
|
||||
margin_top = 24.0
|
||||
margin_right = 112.0
|
||||
margin_bottom = 38.0
|
||||
text = "Congratulations! you beat the demo!
|
||||
Your high score is:
|
||||
|
||||
|
||||
|
||||
Press \"R\" to play again!"
|
||||
|
||||
[node name="Score" type="Label" parent="."]
|
||||
margin_left = 136.0
|
||||
margin_top = 41.0
|
||||
margin_right = 235.0
|
||||
margin_bottom = 55.0
|
||||
text = "000000"
|
4
maps/map01.gd
Normal file
4
maps/map01.gd
Normal file
|
@ -0,0 +1,4 @@
|
|||
extends Node2D
|
||||
|
||||
func _ready():
|
||||
Game.play_sound(load("res://audio/music/rumble_loop.mp3"),Game.ac_music)
|
204
maps/map01.tscn
204
maps/map01.tscn
File diff suppressed because one or more lines are too long
|
@ -16,6 +16,7 @@ func _process(delta):
|
|||
#Scroll screen when player is on different sector
|
||||
current_sector = (player.global_position / resolution).floor()
|
||||
if current_sector != last_sector:
|
||||
Game.respawn_point = player.global_position + Vector2(8,0)
|
||||
if scroll_h: position.x = current_sector.x * resolution.x
|
||||
if scroll_v: position.y = current_sector.y * resolution.y
|
||||
last_sector = current_sector
|
||||
|
|
6
objects/death tile/death_tile.gd
Normal file
6
objects/death tile/death_tile.gd
Normal file
|
@ -0,0 +1,6 @@
|
|||
extends Area2D
|
||||
|
||||
func _on_Area2D_area_entered(area):
|
||||
#Kill player
|
||||
if area.is_in_group("player"):
|
||||
area.get_parent().die()
|
15
objects/death tile/death_tile.tscn
Normal file
15
objects/death tile/death_tile.tscn
Normal file
|
@ -0,0 +1,15 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://objects/death tile/death_tile.gd" type="Script" id=1]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 4, 4 )
|
||||
|
||||
[node name="Area2D" type="Area2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 4, 4 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_Area2D_area_entered"]
|
|
@ -26,7 +26,7 @@ animations = [ {
|
|||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=5]
|
||||
extents = Vector2( 5, 5 )
|
||||
extents = Vector2( 4, 4 )
|
||||
|
||||
[node name="Bat" type="Node2D"]
|
||||
script = ExtResource( 3 )
|
||||
|
@ -39,7 +39,6 @@ flip_sprite = false
|
|||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
material = SubResource( 1 )
|
||||
frames = SubResource( 4 )
|
||||
frame = 1
|
||||
playing = true
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
|
|
@ -26,7 +26,7 @@ animations = [ {
|
|||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=5]
|
||||
extents = Vector2( 5.5, 6 )
|
||||
extents = Vector2( 4, 4 )
|
||||
|
||||
[node name="Snake" type="Node2D"]
|
||||
script = ExtResource( 3 )
|
||||
|
@ -35,13 +35,12 @@ score_for_killing = 15
|
|||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
material = SubResource( 1 )
|
||||
frames = SubResource( 4 )
|
||||
frame = 1
|
||||
playing = true
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2( 0.5, 2 )
|
||||
position = Vector2( 0, 4 )
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_Area2D_area_entered"]
|
||||
|
|
19
objects/exit/exit.gd
Normal file
19
objects/exit/exit.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
extends Node2D
|
||||
|
||||
export var cost = 0
|
||||
onready var label = $Label
|
||||
onready var anims = $AnimationPlayer
|
||||
|
||||
func _ready():
|
||||
anims.play("closed")
|
||||
label.text = str(cost)
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
if Game.shards >= cost:
|
||||
anims.play("open")
|
||||
|
||||
func _on_Area2D_area_entered(area):
|
||||
if area.is_in_group("player"):
|
||||
if Game.score > Game.high_score: Game.high_score = Game.score
|
||||
Game.change_map(load("res://maps/demo_end.tscn"))
|
151
objects/exit/exit.tscn
Normal file
151
objects/exit/exit.tscn
Normal file
|
@ -0,0 +1,151 @@
|
|||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://scripts/theme.tres" type="Theme" id=1]
|
||||
[ext_resource path="res://objects/exit/exit.gd" type="Script" id=2]
|
||||
[ext_resource path="res://graphics/exit/exit.png" type="Texture" id=3]
|
||||
[ext_resource path="res://scripts/1px_border.gdshader" type="Shader" id=4]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=1]
|
||||
shader = ExtResource( 4 )
|
||||
shader_param/border_color = Color( 0, 0, 0, 1 )
|
||||
shader_param/border_corners = true
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 8, 7.5 )
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
resource_name = "closed"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:region_rect")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Rect2( 0, 0, 16, 24 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Area2D/CollisionShape2D:disabled")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ true ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("Label:visible")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ true ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("Sprite:modulate")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
resource_name = "open"
|
||||
length = 0.8
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:region_rect")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Rect2( 16, 0, 16, 24 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Area2D/CollisionShape2D:disabled")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ false ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("Label:visible")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ false ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("Sprite:modulate")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/keys = {
|
||||
"times": PoolRealArray( 0, 0.4, 0.8 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 0, 0, 1 ), Color( 0, 1, 0.203922, 1 ), Color( 1, 0, 0, 1 ) ]
|
||||
}
|
||||
|
||||
[node name="Exit" type="Node2D"]
|
||||
z_index = -1
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
visible = false
|
||||
margin_left = -3.0
|
||||
margin_top = -15.0
|
||||
margin_right = 37.0
|
||||
margin_bottom = 5.0
|
||||
theme = ExtResource( 1 )
|
||||
text = "2"
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
material = SubResource( 1 )
|
||||
texture = ExtResource( 3 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 0, 0, 16, 24 )
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
z_index = -3
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2( 0, 4.5 )
|
||||
shape = SubResource( 2 )
|
||||
disabled = true
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
anims/closed = SubResource( 3 )
|
||||
anims/open = SubResource( 4 )
|
||||
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_Area2D_area_entered"]
|
|
@ -9,6 +9,8 @@ onready var blue_star = $BlueStar
|
|||
onready var magenta_star = $MagentaStar
|
||||
onready var score_counter = $ScoreCounter
|
||||
onready var arrow_counter = $ArrowCounter
|
||||
onready var lives_counter = $LivesCounter
|
||||
onready var high_counter = $HighCounter
|
||||
|
||||
func _physics_process(delta):
|
||||
#Gold Counter
|
||||
|
@ -25,3 +27,8 @@ func _physics_process(delta):
|
|||
score_counter.text = "%06d" % Game.score
|
||||
#Arrow Counter
|
||||
arrow_counter.text = "%02d" % Game.arrows
|
||||
##TOUCH UP LATER
|
||||
#Lives counter
|
||||
lives_counter.text = str("LIVES:") + str(Game.lives)
|
||||
#High counter
|
||||
high_counter.text = str("HIGH:") + str("%06d" % Game.high_score)
|
||||
|
|
|
@ -115,6 +115,22 @@ margin_bottom = 21.0
|
|||
theme = ExtResource( 10 )
|
||||
text = "000000"
|
||||
|
||||
[node name="HighCounter" type="Label" parent="HUD"]
|
||||
margin_left = 178.0
|
||||
margin_top = 178.0
|
||||
margin_right = 262.0
|
||||
margin_bottom = 198.0
|
||||
theme = ExtResource( 10 )
|
||||
text = "High:000000"
|
||||
|
||||
[node name="LivesCounter" type="Label" parent="HUD"]
|
||||
margin_left = 1.0
|
||||
margin_top = 178.0
|
||||
margin_right = 85.0
|
||||
margin_bottom = 198.0
|
||||
theme = ExtResource( 10 )
|
||||
text = "Lives:2"
|
||||
|
||||
[node name="ArrowCounter" type="Label" parent="HUD"]
|
||||
margin_left = 237.0
|
||||
margin_top = 1.0
|
||||
|
|
|
@ -24,8 +24,11 @@ var jump_force = 150
|
|||
var doublejump_force = 120
|
||||
var current_ladder = null #Used for checking climbing every frame instead of area entered
|
||||
var can_doublejump = true
|
||||
var can_move_in_air = false
|
||||
#Positions
|
||||
var arrowpos = Vector2(5,3)
|
||||
#Tiles
|
||||
onready var deathtiles = map.get_node("Death")
|
||||
##Preload
|
||||
var pre_arrow = preload("res://objects/player/arrow_projectile.tscn")
|
||||
|
||||
|
@ -95,8 +98,9 @@ func _process_walk():
|
|||
collision.get_collider().push(collision.normal)
|
||||
|
||||
func _process_idle_walk():
|
||||
can_doublejump = false
|
||||
can_move_in_air = false
|
||||
velocity.y = 0
|
||||
can_doublejump = true
|
||||
#Goto Fall
|
||||
if !is_on_floor(): current_state = State.FALL
|
||||
#Goto Jump
|
||||
|
@ -123,6 +127,8 @@ func _process_fall():
|
|||
if is_on_floor():
|
||||
current_state = State.IDLE
|
||||
return
|
||||
#Cant move in air
|
||||
if !can_move_in_air: velocity.x = 0
|
||||
|
||||
func _process_jump_fall():
|
||||
check_double_jump()
|
||||
|
@ -131,6 +137,7 @@ func _process_jump_fall():
|
|||
check_shoot()
|
||||
|
||||
func _process_climb():
|
||||
can_move_in_air = true
|
||||
can_doublejump = true
|
||||
#Graphics
|
||||
anims.play("climb")
|
||||
|
@ -184,6 +191,8 @@ func check_jump():
|
|||
position.x -= sprite.scale.x * 5
|
||||
anims.set_speed_scale(1)
|
||||
# Jump
|
||||
can_doublejump = true
|
||||
can_move_in_air = true
|
||||
velocity.y = 0
|
||||
jump_pressure = 0
|
||||
current_state = State.JUMP
|
||||
|
@ -209,9 +218,10 @@ func check_shoot():
|
|||
anims.play("shoot air") #Shoot immediately in air
|
||||
|
||||
func move(hsp,vsp,flip:bool):
|
||||
velocity.x = hsp * axis.x
|
||||
#Flip
|
||||
if flip: if sign(axis.x) != 0: sprite.scale.x = axis.x
|
||||
if is_on_floor() or can_move_in_air:
|
||||
velocity.x = hsp * axis.x
|
||||
#Flip
|
||||
if flip: if sign(axis.x) != 0: sprite.scale.x = axis.x
|
||||
|
||||
func check_ladder():
|
||||
if climb_ray.get_collider() != null:
|
||||
|
@ -231,7 +241,20 @@ func check_ladder():
|
|||
climb_ray.position.x = 4 * sprite.scale.x
|
||||
|
||||
func die():
|
||||
get_tree().reload_current_scene()
|
||||
position = Game.respawn_point
|
||||
Game.lives -= 1
|
||||
Game.play_sound(Game.a_die,Game.ac_die)
|
||||
if Game.lives < 0:
|
||||
if Game.score > Game.high_score: Game.high_score = Game.score
|
||||
Game.score = 0
|
||||
Game.golds = 0
|
||||
Game.stars = [false,false,false,false,false]
|
||||
Game.shards = 0
|
||||
Game.arrows = 0
|
||||
Game.lives = 2
|
||||
Game.ac_climb.stop()
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
|
||||
func _on_AnimationPlayer_animation_finished(anim_name):
|
||||
#Return to idle after slash
|
||||
|
@ -255,3 +278,4 @@ func debug():
|
|||
if Input.is_action_pressed("debug_move_player"):
|
||||
position = get_viewport().get_mouse_position()
|
||||
print(get_viewport().get_mouse_position())
|
||||
|
||||
|
|
|
@ -93,15 +93,17 @@ script = ExtResource( 1 )
|
|||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 4, 4 )
|
||||
rotation = 1.5708
|
||||
texture = ExtResource( 2 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 0, 0, 8, 8 )
|
||||
region_rect = Rect2( 8, 0, 8, 8 )
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
|
||||
position = Vector2( 4, 4 )
|
||||
shape = SubResource( 1 )
|
||||
disabled = true
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
anims/idle = SubResource( 2 )
|
||||
|
|
|
@ -64,6 +64,7 @@ ogg_vorbis={
|
|||
jump={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":88,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
|
||||
]
|
||||
}
|
||||
debug_restart={
|
||||
|
@ -94,6 +95,12 @@ debug_move_player={
|
|||
shoot={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
|
||||
]
|
||||
}
|
||||
fullscreen={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":70,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
|
|
70
tilesets/t_death.tres
Normal file
70
tilesets/t_death.tres
Normal file
|
@ -0,0 +1,70 @@
|
|||
[gd_resource type="TileSet" load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/tiles/water.tres" type="Texture" id=1]
|
||||
[ext_resource path="res://graphics/tiles/spike.png" type="Texture" id=2]
|
||||
[ext_resource path="res://graphics/tiles/water_bottom.png" type="Texture" id=3]
|
||||
|
||||
[resource]
|
||||
0/name = "water.tres 0"
|
||||
0/texture = ExtResource( 1 )
|
||||
0/tex_offset = Vector2( 0, 0 )
|
||||
0/modulate = Color( 1, 1, 1, 1 )
|
||||
0/region = Rect2( 0, 0, 8, 8 )
|
||||
0/tile_mode = 2
|
||||
0/autotile/icon_coordinate = Vector2( 0, 0 )
|
||||
0/autotile/tile_size = Vector2( 8, 8 )
|
||||
0/autotile/spacing = 0
|
||||
0/autotile/occluder_map = [ ]
|
||||
0/autotile/navpoly_map = [ ]
|
||||
0/autotile/priority_map = [ ]
|
||||
0/autotile/z_index_map = [ ]
|
||||
0/occluder_offset = Vector2( 0, 0 )
|
||||
0/navigation_offset = Vector2( 0, 0 )
|
||||
0/shape_offset = Vector2( 0, 0 )
|
||||
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
0/shape_one_way = false
|
||||
0/shape_one_way_margin = 0.0
|
||||
0/shapes = [ ]
|
||||
0/z_index = 0
|
||||
1/name = "spike.png 1"
|
||||
1/texture = ExtResource( 2 )
|
||||
1/tex_offset = Vector2( 0, 0 )
|
||||
1/modulate = Color( 1, 1, 1, 1 )
|
||||
1/region = Rect2( 0, 0, 8, 8 )
|
||||
1/tile_mode = 0
|
||||
1/occluder_offset = Vector2( 0, 0 )
|
||||
1/navigation_offset = Vector2( 0, 0 )
|
||||
1/shape_offset = Vector2( 0, 0 )
|
||||
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
1/shape_one_way = false
|
||||
1/shape_one_way_margin = 0.0
|
||||
1/shapes = [ ]
|
||||
1/z_index = 0
|
||||
2/name = "spike.png 2"
|
||||
2/texture = ExtResource( 2 )
|
||||
2/tex_offset = Vector2( 0, 0 )
|
||||
2/modulate = Color( 1, 1, 1, 1 )
|
||||
2/region = Rect2( 8, 0, 8, 8 )
|
||||
2/tile_mode = 0
|
||||
2/occluder_offset = Vector2( 0, 0 )
|
||||
2/navigation_offset = Vector2( 0, 0 )
|
||||
2/shape_offset = Vector2( 0, 0 )
|
||||
2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
2/shape_one_way = false
|
||||
2/shape_one_way_margin = 0.0
|
||||
2/shapes = [ ]
|
||||
2/z_index = 0
|
||||
3/name = "water_bottom.png 3"
|
||||
3/texture = ExtResource( 3 )
|
||||
3/tex_offset = Vector2( 0, 0 )
|
||||
3/modulate = Color( 1, 1, 1, 1 )
|
||||
3/region = Rect2( 0, 0, 8, 8 )
|
||||
3/tile_mode = 0
|
||||
3/occluder_offset = Vector2( 0, 0 )
|
||||
3/navigation_offset = Vector2( 0, 0 )
|
||||
3/shape_offset = Vector2( 0, 0 )
|
||||
3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
3/shape_one_way = false
|
||||
3/shape_one_way_margin = 0.0
|
||||
3/shapes = [ ]
|
||||
3/z_index = 0
|
|
@ -1,26 +0,0 @@
|
|||
[gd_resource type="TileSet" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/tiles/water.tres" type="Texture" id=1]
|
||||
|
||||
[resource]
|
||||
0/name = "water.tres 0"
|
||||
0/texture = ExtResource( 1 )
|
||||
0/tex_offset = Vector2( 0, 0 )
|
||||
0/modulate = Color( 1, 1, 1, 1 )
|
||||
0/region = Rect2( 0, 0, 8, 8 )
|
||||
0/tile_mode = 2
|
||||
0/autotile/icon_coordinate = Vector2( 0, 0 )
|
||||
0/autotile/tile_size = Vector2( 8, 8 )
|
||||
0/autotile/spacing = 0
|
||||
0/autotile/occluder_map = [ ]
|
||||
0/autotile/navpoly_map = [ ]
|
||||
0/autotile/priority_map = [ ]
|
||||
0/autotile/z_index_map = [ ]
|
||||
0/occluder_offset = Vector2( 0, 0 )
|
||||
0/navigation_offset = Vector2( 0, 0 )
|
||||
0/shape_offset = Vector2( 0, 0 )
|
||||
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
0/shape_one_way = false
|
||||
0/shape_one_way_margin = 0.0
|
||||
0/shapes = [ ]
|
||||
0/z_index = 0
|
Loading…
Add table
Add a link
Reference in a new issue