From ec7314eb91b4fbcf110be399c6e3315288facc2b Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Mon, 17 Aug 2020 17:27:28 +0200 Subject: [PATCH] game1: add player and tilemap --- images/game1/game1_animationRight.png | Bin 0 -> 259 bytes images/game1/game1_animationRight.png.import | 34 ++ images/game1/game1_player.tres | 36 ++ images/game1/game1_tileset.png | Bin 0 -> 5719 bytes images/game1/game1_tileset.png.import | 34 ++ images/game1/tileset.tres | 383 ++++++++++++++++++ scenes/game1.tscn | 64 ++- .../opening2_player.tscn} | 0 scripts/game1/Game1Script.gd | 63 ++- 9 files changed, 590 insertions(+), 24 deletions(-) create mode 100644 images/game1/game1_animationRight.png create mode 100644 images/game1/game1_animationRight.png.import create mode 100644 images/game1/game1_player.tres create mode 100644 images/game1/game1_tileset.png create mode 100644 images/game1/game1_tileset.png.import create mode 100644 images/game1/tileset.tres rename scenes/{player.tscn => game1/opening2_player.tscn} (100%) diff --git a/images/game1/game1_animationRight.png b/images/game1/game1_animationRight.png new file mode 100644 index 0000000000000000000000000000000000000000..c351d92d62910898dc7efb5de75b2ec382c65ffd GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^3xHUFgAGVdWG#sRQjEnx?oJHr&dIz4a`t+CH^{HvUR^m?U&E{lw8V4Qv0GZM?W?)#pjwFF#*6dRaXv zZ`rOX=F@+<1^1t40~&KD_MO`LeUBbr+W!1{F*C?LjXxR7eUBeIpsEGpF?hQAxvXU8 literal 0 HcmV?d00001 diff --git a/images/game1/game1_animationRight.png.import b/images/game1/game1_animationRight.png.import new file mode 100644 index 0000000..cf89f01 --- /dev/null +++ b/images/game1/game1_animationRight.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/game1_animationRight.png-29e3e4828a3eddd264542fe8c76bb461.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/game1/game1_animationRight.png" +dest_files=[ "res://.import/game1_animationRight.png-29e3e4828a3eddd264542fe8c76bb461.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/game1/game1_player.tres b/images/game1/game1_player.tres new file mode 100644 index 0000000..5cc189d --- /dev/null +++ b/images/game1/game1_player.tres @@ -0,0 +1,36 @@ +[gd_resource type="SpriteFrames" load_steps=7 format=2] + +[ext_resource path="res://images/game1/game1_animationRight.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 32, 16 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 32, 0, 32, 16 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 1 ) +region = Rect2( 64, 0, 32, 16 ) + +[sub_resource type="AtlasTexture" id=4] +atlas = ExtResource( 1 ) +region = Rect2( 96, 0, 32, 16 ) + +[sub_resource type="AtlasTexture" id=5] +atlas = ExtResource( 1 ) +region = Rect2( 128, 0, 32, 16 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ) ], +"loop": false, +"name": "default", +"speed": 5.0 +}, { +"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ], +"loop": false, +"name": "moving", +"speed": 10.0 +} ] diff --git a/images/game1/game1_tileset.png b/images/game1/game1_tileset.png new file mode 100644 index 0000000000000000000000000000000000000000..d37305622e716e84d7f9199ef20ce30155be0014 GIT binary patch literal 5719 zcmV-d7O3foP)Py05lKWrRCt{2UFnkatO_ zr@rGzB$|2s+W)tD0FL7jLkQuwuXb&&C%_rR(S%JDhZqJk>HkJHj(~a@$!yo^!slD8 z;0v+Kyx!KqbzL$1jVq@ClX1>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nAfb)omz7_@93ix;Sgu~Z8&&22_5^CkpUxa1xEIS&0p_U!gbyA$MEmBF-Hg;r~X24^~wm;X}y*6ih8jK^@{rc6>tf%4k!_FCmd%(c@}(+ zK^wyvWDO*7q!EX%q!67m7nD058YA6W{b{?A=u447$W{RF&o?{|LlB7zrh*H|mYc@}boA*^a!T`Vw z)*LFsymmDXbB+8Af|RIDt5mCD{c;R~-lXU16^h~W@slF2BS0ez8ylr!72DV@k=-w# z=FtjsC3+tBkl=NMk{ARUm-y{n<(IiQcr@D~8!?F{Aoxm}NDKle0=>x_q(EaH8^<5+ zdC^MWjiTt*WlB zz$ao3NRFVs#*F#4rBO!t-OYgZXTjWlI(afq1)9Q>qxNMq!G7J|!XW1G$=DB)7>YB< zB=}_PgQOnR3=~(fCc-CUZ_FZGtA1V=L-A{W_QtGp9u5M2qR;{143l97gZPAh2NE0V zD2!&1S521VdvF!YfuUz(dzF#y4B~Jw7|9@hm+u*9J~a0QxCC*8z%$9Gk5-Rj5SJb= zKw85uU)13e#F6m4N*=%R^izzonn6A_*(U;inJ2i>=Jo5hnn4_U;mUp>Q#^iu0i%4@ zk}uo&`YkBOAT1_1Cr{mc1Ec9jukVo5Y2g_LXOMT}6`8$DRje<2M?Qe#nInWr41zF% zyMY}?z>Rc=gTW96(OjU$s97#z9Lupnf=F&5jM;Bz6vr}5V-Tf5et{o{V+pJoMD@KG z;Qpu2L}wl6!1`A3=ZBT=#z5c_!?6vlh*9)~J0bX&zc|i9FOl}DL;2S!IKw!$Ln~2A zzjeytI2!&v5)OyM;cz${4u`|xa5x+ehr{7;I2;a#!{Kn`_&=1002ov JPDHLkV1hwR&z}GQ literal 0 HcmV?d00001 diff --git a/images/game1/game1_tileset.png.import b/images/game1/game1_tileset.png.import new file mode 100644 index 0000000..fc4c4b0 --- /dev/null +++ b/images/game1/game1_tileset.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/game1_tileset.png-6bff9e80c12445fcb52c690a5902efcf.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/game1/game1_tileset.png" +dest_files=[ "res://.import/game1_tileset.png-6bff9e80c12445fcb52c690a5902efcf.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/game1/tileset.tres b/images/game1/tileset.tres new file mode 100644 index 0000000..1e4e619 --- /dev/null +++ b/images/game1/tileset.tres @@ -0,0 +1,383 @@ +[gd_resource type="TileSet" load_steps=2 format=2] + +[ext_resource path="res://images/game1/game1_tileset.png" type="Texture" id=1] + +[resource] +2/name = "game1_tileset.png 2" +2/texture = ExtResource( 1 ) +2/tex_offset = Vector2( 0, 0 ) +2/modulate = Color( 1, 1, 1, 1 ) +2/region = Rect2( 48, 16, 48, 16 ) +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 = "game1_tileset.png 3" +3/texture = ExtResource( 1 ) +3/tex_offset = Vector2( 0, 0 ) +3/modulate = Color( 1, 1, 1, 1 ) +3/region = Rect2( 112, 16, 64, 32 ) +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 +4/name = "game1_tileset.png 4" +4/texture = ExtResource( 1 ) +4/tex_offset = Vector2( 0, 0 ) +4/modulate = Color( 1, 1, 1, 1 ) +4/region = Rect2( 48, 32, 16, 16 ) +4/tile_mode = 0 +4/occluder_offset = Vector2( 0, 0 ) +4/navigation_offset = Vector2( 0, 0 ) +4/shape_offset = Vector2( 0, 0 ) +4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +4/shape_one_way = false +4/shape_one_way_margin = 0.0 +4/shapes = [ ] +4/z_index = 0 +5/name = "game1_tileset.png 5" +5/texture = ExtResource( 1 ) +5/tex_offset = Vector2( 0, 0 ) +5/modulate = Color( 1, 1, 1, 1 ) +5/region = Rect2( 64, 32, 16, 16 ) +5/tile_mode = 0 +5/occluder_offset = Vector2( 0, 0 ) +5/navigation_offset = Vector2( 0, 0 ) +5/shape_offset = Vector2( 0, 0 ) +5/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +5/shape_one_way = false +5/shape_one_way_margin = 0.0 +5/shapes = [ ] +5/z_index = 0 +6/name = "game1_tileset.png 6" +6/texture = ExtResource( 1 ) +6/tex_offset = Vector2( 0, 0 ) +6/modulate = Color( 1, 1, 1, 1 ) +6/region = Rect2( 48, 48, 16, 32 ) +6/tile_mode = 0 +6/occluder_offset = Vector2( 0, 0 ) +6/navigation_offset = Vector2( 0, 0 ) +6/shape_offset = Vector2( 0, 0 ) +6/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +6/shape_one_way = false +6/shape_one_way_margin = 0.0 +6/shapes = [ ] +6/z_index = 0 +7/name = "game1_tileset.png 7" +7/texture = ExtResource( 1 ) +7/tex_offset = Vector2( 0, 0 ) +7/modulate = Color( 1, 1, 1, 1 ) +7/region = Rect2( 64, 48, 16, 16 ) +7/tile_mode = 0 +7/occluder_offset = Vector2( 0, 0 ) +7/navigation_offset = Vector2( 0, 0 ) +7/shape_offset = Vector2( 0, 0 ) +7/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +7/shape_one_way = false +7/shape_one_way_margin = 0.0 +7/shapes = [ ] +7/z_index = 0 +8/name = "game1_tileset.png 8" +8/texture = ExtResource( 1 ) +8/tex_offset = Vector2( 0, 0 ) +8/modulate = Color( 1, 1, 1, 1 ) +8/region = Rect2( 16, 48, 32, 16 ) +8/tile_mode = 0 +8/occluder_offset = Vector2( 0, 0 ) +8/navigation_offset = Vector2( 0, 0 ) +8/shape_offset = Vector2( 0, 0 ) +8/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +8/shape_one_way = false +8/shape_one_way_margin = 0.0 +8/shapes = [ ] +8/z_index = 0 +9/name = "game1_tileset.png 9" +9/texture = ExtResource( 1 ) +9/tex_offset = Vector2( 0, 0 ) +9/modulate = Color( 1, 1, 1, 1 ) +9/region = Rect2( 16, 64, 32, 16 ) +9/tile_mode = 0 +9/occluder_offset = Vector2( 0, 0 ) +9/navigation_offset = Vector2( 0, 0 ) +9/shape_offset = Vector2( 0, 0 ) +9/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +9/shape_one_way = false +9/shape_one_way_margin = 0.0 +9/shapes = [ ] +9/z_index = 0 +10/name = "game1_tileset.png 10" +10/texture = ExtResource( 1 ) +10/tex_offset = Vector2( 0, 0 ) +10/modulate = Color( 1, 1, 1, 1 ) +10/region = Rect2( 64, 64, 16, 16 ) +10/tile_mode = 0 +10/occluder_offset = Vector2( 0, 0 ) +10/navigation_offset = Vector2( 0, 0 ) +10/shape_offset = Vector2( 0, 0 ) +10/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +10/shape_one_way = false +10/shape_one_way_margin = 0.0 +10/shapes = [ ] +10/z_index = 0 +11/name = "game1_tileset.png 11" +11/texture = ExtResource( 1 ) +11/tex_offset = Vector2( 0, 0 ) +11/modulate = Color( 1, 1, 1, 1 ) +11/region = Rect2( 64, 80, 16, 16 ) +11/tile_mode = 0 +11/occluder_offset = Vector2( 0, 0 ) +11/navigation_offset = Vector2( 0, 0 ) +11/shape_offset = Vector2( 0, 0 ) +11/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +11/shape_one_way = false +11/shape_one_way_margin = 0.0 +11/shapes = [ ] +11/z_index = 0 +12/name = "game1_tileset.png 12" +12/texture = ExtResource( 1 ) +12/tex_offset = Vector2( 0, 0 ) +12/modulate = Color( 1, 1, 1, 1 ) +12/region = Rect2( 80, 64, 16, 16 ) +12/tile_mode = 0 +12/occluder_offset = Vector2( 0, 0 ) +12/navigation_offset = Vector2( 0, 0 ) +12/shape_offset = Vector2( 0, 0 ) +12/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +12/shape_one_way = false +12/shape_one_way_margin = 0.0 +12/shapes = [ ] +12/z_index = 0 +13/name = "game1_tileset.png 13" +13/texture = ExtResource( 1 ) +13/tex_offset = Vector2( 0, 0 ) +13/modulate = Color( 1, 1, 1, 1 ) +13/region = Rect2( 80, 80, 16, 16 ) +13/tile_mode = 0 +13/occluder_offset = Vector2( 0, 0 ) +13/navigation_offset = Vector2( 0, 0 ) +13/shape_offset = Vector2( 0, 0 ) +13/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +13/shape_one_way = false +13/shape_one_way_margin = 0.0 +13/shapes = [ ] +13/z_index = 0 +14/name = "game1_tileset.png 14" +14/texture = ExtResource( 1 ) +14/tex_offset = Vector2( 0, 0 ) +14/modulate = Color( 1, 1, 1, 1 ) +14/region = Rect2( 96, 80, 16, 16 ) +14/tile_mode = 0 +14/occluder_offset = Vector2( 0, 0 ) +14/navigation_offset = Vector2( 0, 0 ) +14/shape_offset = Vector2( 0, 0 ) +14/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +14/shape_one_way = false +14/shape_one_way_margin = 0.0 +14/shapes = [ ] +14/z_index = 0 +15/name = "game1_tileset.png 15" +15/texture = ExtResource( 1 ) +15/tex_offset = Vector2( 0, 0 ) +15/modulate = Color( 1, 1, 1, 1 ) +15/region = Rect2( 96, 64, 16, 16 ) +15/tile_mode = 0 +15/occluder_offset = Vector2( 0, 0 ) +15/navigation_offset = Vector2( 0, 0 ) +15/shape_offset = Vector2( 0, 0 ) +15/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +15/shape_one_way = false +15/shape_one_way_margin = 0.0 +15/shapes = [ ] +15/z_index = 0 +17/name = "game1_tileset.png 17" +17/texture = ExtResource( 1 ) +17/tex_offset = Vector2( 0, 0 ) +17/modulate = Color( 1, 1, 1, 1 ) +17/region = Rect2( 112, 48, 16, 16 ) +17/tile_mode = 0 +17/occluder_offset = Vector2( 0, 0 ) +17/navigation_offset = Vector2( 0, 0 ) +17/shape_offset = Vector2( 0, 0 ) +17/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +17/shape_one_way = false +17/shape_one_way_margin = 0.0 +17/shapes = [ ] +17/z_index = 0 +18/name = "game1_tileset.png 18" +18/texture = ExtResource( 1 ) +18/tex_offset = Vector2( 0, 0 ) +18/modulate = Color( 1, 1, 1, 1 ) +18/region = Rect2( 128, 48, 16, 16 ) +18/tile_mode = 0 +18/occluder_offset = Vector2( 0, 0 ) +18/navigation_offset = Vector2( 0, 0 ) +18/shape_offset = Vector2( 0, 0 ) +18/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +18/shape_one_way = false +18/shape_one_way_margin = 0.0 +18/shapes = [ ] +18/z_index = 0 +19/name = "game1_tileset.png 19" +19/texture = ExtResource( 1 ) +19/tex_offset = Vector2( 0, 0 ) +19/modulate = Color( 1, 1, 1, 1 ) +19/region = Rect2( 144, 48, 16, 16 ) +19/tile_mode = 0 +19/occluder_offset = Vector2( 0, 0 ) +19/navigation_offset = Vector2( 0, 0 ) +19/shape_offset = Vector2( 0, 0 ) +19/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +19/shape_one_way = false +19/shape_one_way_margin = 0.0 +19/shapes = [ ] +19/z_index = 0 +20/name = "game1_tileset.png 20" +20/texture = ExtResource( 1 ) +20/tex_offset = Vector2( 0, 0 ) +20/modulate = Color( 1, 1, 1, 1 ) +20/region = Rect2( 160, 48, 16, 16 ) +20/tile_mode = 0 +20/occluder_offset = Vector2( 0, 0 ) +20/navigation_offset = Vector2( 0, 0 ) +20/shape_offset = Vector2( 0, 0 ) +20/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +20/shape_one_way = false +20/shape_one_way_margin = 0.0 +20/shapes = [ ] +20/z_index = 0 +29/name = "game1_tileset.png 29" +29/texture = ExtResource( 1 ) +29/tex_offset = Vector2( 0, 0 ) +29/modulate = Color( 1, 1, 1, 1 ) +29/region = Rect2( 80, 32, 32, 32 ) +29/tile_mode = 0 +29/occluder_offset = Vector2( 0, 0 ) +29/navigation_offset = Vector2( 0, 0 ) +29/shape_offset = Vector2( 0, 0 ) +29/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +29/shape_one_way = false +29/shape_one_way_margin = 0.0 +29/shapes = [ ] +29/z_index = 0 +30/name = "big_rock" +30/texture = ExtResource( 1 ) +30/tex_offset = Vector2( 0, 0 ) +30/modulate = Color( 1, 1, 1, 1 ) +30/region = Rect2( 16, 16, 32, 32 ) +30/tile_mode = 0 +30/occluder_offset = Vector2( 0, 0 ) +30/navigation_offset = Vector2( 0, 0 ) +30/shape_offset = Vector2( 0, 0 ) +30/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +30/shape_one_way = false +30/shape_one_way_margin = 0.0 +30/shapes = [ ] +30/z_index = 0 +39/name = "rocks_h_1" +39/texture = ExtResource( 1 ) +39/tex_offset = Vector2( 0, 0 ) +39/modulate = Color( 1, 1, 1, 1 ) +39/region = Rect2( 16, 0, 48, 16 ) +39/tile_mode = 0 +39/occluder_offset = Vector2( 0, 0 ) +39/navigation_offset = Vector2( 0, 0 ) +39/shape_offset = Vector2( 0, 0 ) +39/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +39/shape_one_way = false +39/shape_one_way_margin = 0.0 +39/shapes = [ ] +39/z_index = 0 +40/name = "rock_v" +40/texture = ExtResource( 1 ) +40/tex_offset = Vector2( 0, 0 ) +40/modulate = Color( 1, 1, 1, 1 ) +40/region = Rect2( 0, 16, 16, 32 ) +40/tile_mode = 0 +40/occluder_offset = Vector2( 0, 0 ) +40/navigation_offset = Vector2( 0, 0 ) +40/shape_offset = Vector2( 0, 0 ) +40/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +40/shape_one_way = false +40/shape_one_way_margin = 0.0 +40/shapes = [ ] +40/z_index = 0 +41/name = "small_rocks_1" +41/texture = ExtResource( 1 ) +41/tex_offset = Vector2( 0, 0 ) +41/modulate = Color( 1, 1, 1, 1 ) +41/region = Rect2( 32, 80, 32, 16 ) +41/tile_mode = 0 +41/occluder_offset = Vector2( 0, 0 ) +41/navigation_offset = Vector2( 0, 0 ) +41/shape_offset = Vector2( 0, 0 ) +41/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +41/shape_one_way = false +41/shape_one_way_margin = 0.0 +41/shapes = [ ] +41/z_index = 0 +42/name = "tiny_rock_1" +42/texture = ExtResource( 1 ) +42/tex_offset = Vector2( 0, 0 ) +42/modulate = Color( 1, 1, 1, 1 ) +42/region = Rect2( 112, 0, 16, 16 ) +42/tile_mode = 0 +42/occluder_offset = Vector2( 0, 0 ) +42/navigation_offset = Vector2( 0, 0 ) +42/shape_offset = Vector2( 0, 0 ) +42/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +42/shape_one_way = false +42/shape_one_way_margin = 0.0 +42/shapes = [ ] +42/z_index = 0 +43/name = "tiny_rock_2" +43/texture = ExtResource( 1 ) +43/tex_offset = Vector2( 0, 0 ) +43/modulate = Color( 1, 1, 1, 1 ) +43/region = Rect2( 128, 0, 16, 16 ) +43/tile_mode = 0 +43/occluder_offset = Vector2( 0, 0 ) +43/navigation_offset = Vector2( 0, 0 ) +43/shape_offset = Vector2( 0, 0 ) +43/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +43/shape_one_way = false +43/shape_one_way_margin = 0.0 +43/shapes = [ ] +43/z_index = 0 +44/name = "tiny_rock_3" +44/texture = ExtResource( 1 ) +44/tex_offset = Vector2( 0, 0 ) +44/modulate = Color( 1, 1, 1, 1 ) +44/region = Rect2( 144, 0, 16, 16 ) +44/tile_mode = 0 +44/occluder_offset = Vector2( 0, 0 ) +44/navigation_offset = Vector2( 0, 0 ) +44/shape_offset = Vector2( 0, 0 ) +44/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +44/shape_one_way = false +44/shape_one_way_margin = 0.0 +44/shapes = [ ] +44/z_index = 0 +45/name = "rock_h_2" +45/texture = ExtResource( 1 ) +45/tex_offset = Vector2( 0, 0 ) +45/modulate = Color( 1, 1, 1, 1 ) +45/region = Rect2( 160, 0, 32, 16 ) +45/tile_mode = 0 +45/occluder_offset = Vector2( 0, 0 ) +45/navigation_offset = Vector2( 0, 0 ) +45/shape_offset = Vector2( 0, 0 ) +45/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +45/shape_one_way = false +45/shape_one_way_margin = 0.0 +45/shapes = [ ] +45/z_index = 0 diff --git a/scenes/game1.tscn b/scenes/game1.tscn index 570bfdf..9a2bac0 100644 --- a/scenes/game1.tscn +++ b/scenes/game1.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://images/game1/opening.tres" type="SpriteFrames" id=1] [ext_resource path="res://images/game1/opening2bg.tres" type="SpriteFrames" id=2] [ext_resource path="res://scripts/game1/Game1Script.gd" type="Script" id=3] -[ext_resource path="res://scenes/player.tscn" type="PackedScene" id=4] +[ext_resource path="res://scenes/game1/opening2_player.tscn" type="PackedScene" id=4] [ext_resource path="res://scripts/game1/opening2_next_step_trigger.gd" type="Script" id=5] +[ext_resource path="res://images/game1/tileset.tres" type="TileSet" id=6] +[ext_resource path="res://images/game1/game1_player.tres" type="SpriteFrames" id=7] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 114.063, 10 ) @@ -21,55 +23,77 @@ extents = Vector2( 6.44203, 23.0973 ) [node name="Node2D" type="Node2D"] script = ExtResource( 3 ) -[node name="Opening" type="AnimatedSprite" parent="."] +[node name="Game" type="Node2D" parent="."] + +[node name="Ground" type="TileMap" parent="Game"] +tile_set = ExtResource( 6 ) +cell_size = Vector2( 16, 16 ) +cell_quadrant_size = 8 +cell_custom_transform = Transform2D( 0, 0, 0, 0, 0, 0 ) +format = 1 + +[node name="Props" type="TileMap" parent="Game"] +tile_set = ExtResource( 6 ) +cell_size = Vector2( 16, 16 ) +cell_quadrant_size = 8 +cell_custom_transform = Transform2D( 0, 0, 0, 0, 0, 0 ) +format = 1 + +[node name="Player" type="AnimatedSprite" parent="Game"] +frames = ExtResource( 7 ) + +[node name="Camera2D" type="Camera2D" parent="Game/Player"] + +[node name="Opening2" type="Node2D" parent="."] visible = false -frames = ExtResource( 1 ) -centered = false -[node name="Open2" type="Node2D" parent="."] - -[node name="Opening2Bg" type="AnimatedSprite" parent="Open2"] +[node name="Opening2Bg" type="AnimatedSprite" parent="Opening2"] frames = ExtResource( 2 ) centered = false -[node name="Player" parent="Open2" instance=ExtResource( 4 )] +[node name="Player" parent="Opening2" instance=ExtResource( 4 )] position = Vector2( -6.22136, 83.6906 ) -[node name="walls" type="Node2D" parent="Open2"] +[node name="walls" type="Node2D" parent="Opening2"] -[node name="StaticBody2D" type="StaticBody2D" parent="Open2/walls"] +[node name="StaticBody2D" type="StaticBody2D" parent="Opening2/walls"] position = Vector2( -6.22136, 83.6906 ) -[node name="CollisionShape2D" type="CollisionShape2D" parent="Open2/walls/StaticBody2D"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Opening2/walls/StaticBody2D"] position = Vector2( 99.7793, 36.875 ) shape = SubResource( 1 ) -[node name="StaticBody2D2" type="StaticBody2D" parent="Open2/walls"] +[node name="StaticBody2D2" type="StaticBody2D" parent="Opening2/walls"] position = Vector2( -6.22136, 83.6906 ) -[node name="CollisionShape2D" type="CollisionShape2D" parent="Open2/walls/StaticBody2D2"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Opening2/walls/StaticBody2D2"] position = Vector2( 101.948, -20.3563 ) shape = SubResource( 2 ) -[node name="StaticBody2D3" type="StaticBody2D" parent="Open2/walls"] +[node name="StaticBody2D3" type="StaticBody2D" parent="Opening2/walls"] position = Vector2( -6.22136, 83.6906 ) -[node name="CollisionShape2D" type="CollisionShape2D" parent="Open2/walls/StaticBody2D3"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Opening2/walls/StaticBody2D3"] position = Vector2( -25.6957, 6 ) shape = SubResource( 3 ) -[node name="StaticBody2D4" type="StaticBody2D" parent="Open2/walls"] +[node name="StaticBody2D4" type="StaticBody2D" parent="Opening2/walls"] position = Vector2( -6.22136, 83.6906 ) -[node name="CollisionShape2D" type="CollisionShape2D" parent="Open2/walls/StaticBody2D4"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Opening2/walls/StaticBody2D4"] position = Vector2( 224.921, 6 ) shape = SubResource( 3 ) -[node name="next_step_trigger" type="Area2D" parent="Open2"] +[node name="next_step_trigger" type="Area2D" parent="Opening2"] position = Vector2( -6.22136, 83.6906 ) script = ExtResource( 5 ) root_path = NodePath("../..") -[node name="CollisionShape2D" type="CollisionShape2D" parent="Open2/next_step_trigger"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Opening2/next_step_trigger"] position = Vector2( 210.738, 5 ) shape = SubResource( 4 ) + +[node name="Opening1" type="AnimatedSprite" parent="."] +visible = false +frames = ExtResource( 1 ) +centered = false diff --git a/scenes/player.tscn b/scenes/game1/opening2_player.tscn similarity index 100% rename from scenes/player.tscn rename to scenes/game1/opening2_player.tscn diff --git a/scripts/game1/Game1Script.gd b/scripts/game1/Game1Script.gd index 8cfa592..480e0d0 100644 --- a/scripts/game1/Game1Script.gd +++ b/scripts/game1/Game1Script.gd @@ -1,10 +1,65 @@ extends Node +var playing = false + +onready var player = $Game/Player +onready var player_camera = $Game/Player/Camera2D + func _ready(): - $Opening.play('default') - yield($Opening, 'animation_finished') - $Opening.hide() + launch_game() + $Opening1.play('default') + yield($Opening1, 'animation_finished') + $Opening1.hide() func launch_game(): - $Open2.hide() + $Opening2.hide() + playing = true + player_camera.make_current() + player.connect('frame_changed', self, 'update_camera') + +func _input(event): + if playing && !is_camera_moving: + if event.is_action_pressed('right'): + move_right() + if event.is_action_pressed('left'): + move_left() + +func move_right(): + is_camera_moving = true + player.play('moving') + update_camera() + + yield(player, 'animation_finished') + + is_camera_moving = false + player.play('default') + + player.frame = 0 + player.position.x += 16 + +func move_left(): + player.position.x -= 16 + + is_camera_moving = true + player.play('moving', true) + update_camera() + + yield(player, 'animation_finished') + + is_camera_moving = false + player.play('default') + + player.frame = 0 + + +const animation_steps = [3, 6, 10, 13] +var is_camera_moving = false +func update_camera(): + if is_camera_moving: + player_camera.position = Vector2(animation_steps[player.frame], 0) + print('---') + print(player.frame) + print(animation_steps[player.frame]) + else: + player_camera.position = Vector2()