diff --git a/game-source/assets/box.aseprite b/game-source/assets/box.aseprite new file mode 100644 index 0000000..a6fa6b9 Binary files /dev/null and b/game-source/assets/box.aseprite differ diff --git a/game-source/assets/box.png b/game-source/assets/box.png new file mode 100644 index 0000000..2570ab4 Binary files /dev/null and b/game-source/assets/box.png differ diff --git a/game-source/assets/box.png.import b/game-source/assets/box.png.import new file mode 100644 index 0000000..d455528 --- /dev/null +++ b/game-source/assets/box.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c6jm42o02gsfr" +path="res://.godot/imported/box.png-52cc4e41fddadef836f9ad4dbe7936fa.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/box.png" +dest_files=["res://.godot/imported/box.png-52cc4e41fddadef836f9ad4dbe7936fa.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/game-source/assets/button-tile.aseprite b/game-source/assets/button-tile.aseprite new file mode 100644 index 0000000..ac4b925 Binary files /dev/null and b/game-source/assets/button-tile.aseprite differ diff --git a/game-source/assets/lil_guy.aseprite b/game-source/assets/lil_guy.aseprite new file mode 100644 index 0000000..c2990e2 Binary files /dev/null and b/game-source/assets/lil_guy.aseprite differ diff --git a/game-source/assets/lil_guy.png b/game-source/assets/lil_guy.png new file mode 100644 index 0000000..dbfac59 Binary files /dev/null and b/game-source/assets/lil_guy.png differ diff --git a/game-source/assets/lil_guy.png.import b/game-source/assets/lil_guy.png.import new file mode 100644 index 0000000..639c993 --- /dev/null +++ b/game-source/assets/lil_guy.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cf7mjmudnjchn" +path="res://.godot/imported/lil_guy.png-5b8522e296156f74a537c04ff5d11eca.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/lil_guy.png" +dest_files=["res://.godot/imported/lil_guy.png-5b8522e296156f74a537c04ff5d11eca.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/game-source/box.tscn b/game-source/box.tscn new file mode 100644 index 0000000..c27965b --- /dev/null +++ b/game-source/box.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=2 format=3 uid="uid://cv6rvnsd8jc4u"] + +[ext_resource type="Texture2D" uid="uid://c6jm42o02gsfr" path="res://assets/box.png" id="1_q4dmh"] + +[node name="CharacterBody2D" type="CharacterBody2D"] + +[node name="Box" type="Sprite2D" parent="."] +position = Vector2(33, 52) +texture = ExtResource("1_q4dmh") + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] +visible = false +position = Vector2(36, 52) +polygon = PackedVector2Array(16, -124.8, 16, -122.9, 29, -111.9, 29, -109.4, 40.2, -85, 41.1, -85, 51, -69.6, 51, -59, 48.7, -59, 47, -57.9, 47, -57, 49.1, -24, 47.8, -24, 45.8, -8, 45, -8, 45, -4, 43, -4, 36, 5, 33.2, 5, 12, 7.2, 12, 5.89999, -13, 4.10001, -13, 4.89999, -80, 8.10001, -80, 6.10001, -93, -1.89999, -93, -4.60001, -95.4, -11, -98.1, -11, -102.1, -17, -105.2, -17, -115, -19.4, -115, -21.3, -122, -31, -123.6, -31, -149, -46.9, -149, -54, -150, -91, -150, -128, -148.6, -128, -137.6, -135, -127.2, -135, -120, -135.8, -120, -137.2) diff --git a/game-source/main.tscn b/game-source/main.tscn index 1cc7cab..5761a76 100644 --- a/game-source/main.tscn +++ b/game-source/main.tscn @@ -1,21 +1,22 @@ -[gd_scene load_steps=2 format=3 uid="uid://2t2nbl4hrw8b"] +[gd_scene load_steps=3 format=3 uid="uid://2t2nbl4hrw8b"] -[ext_resource type="Texture2D" uid="uid://oc0ftdvgh6n0" path="res://assets/main_menu.png" id="1_2b8xh"] +[ext_resource type="PackedScene" uid="uid://xqoiyxrn10js" path="res://player_character.tscn" id="1_j2rm2"] +[ext_resource type="PackedScene" uid="uid://cv6rvnsd8jc4u" path="res://box.tscn" id="2_n627q"] -[node name="Node2D" type="Node2D"] +[node name="GameLevel" type="Node2D"] -[node name="CanvasLayer" type="CanvasLayer" parent="."] +[node name="PlayerCharacter" parent="." instance=ExtResource("1_j2rm2")] +position = Vector2(607, 323) +move_speed = 1000.0 -[node name="TextureRect" type="TextureRect" parent="CanvasLayer"] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_left = 4.0 -offset_top = -149.0 -offset_right = 1.0 -offset_bottom = 227.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -texture = ExtResource("1_2b8xh") +[node name="box" parent="." instance=ExtResource("2_n627q")] +position = Vector2(986, 524) + +[node name="box2" parent="." instance=ExtResource("2_n627q")] +position = Vector2(140, -16) + +[node name="box3" parent="." instance=ExtResource("2_n627q")] +position = Vector2(189, 538) + +[node name="box4" parent="." instance=ExtResource("2_n627q")] +position = Vector2(1120, -33) diff --git a/game-source/player_character.gd b/game-source/player_character.gd new file mode 100644 index 0000000..2bff2fd --- /dev/null +++ b/game-source/player_character.gd @@ -0,0 +1,15 @@ +extends CharacterBody2D + + +@export var move_speed: float = 400 + + +func _physics_process(delta): + var input_dir = Vector2( + Input.get_action_strength("right") - Input. get_action_strength("left"), + Input.get_action_strength("down") - Input.get_action_strength("up") + ) + + velocity = input_dir*move_speed + + move_and_slide() diff --git a/game-source/player_character.tscn b/game-source/player_character.tscn new file mode 100644 index 0000000..eadb214 --- /dev/null +++ b/game-source/player_character.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=3 format=3 uid="uid://xqoiyxrn10js"] + +[ext_resource type="Texture2D" uid="uid://cf7mjmudnjchn" path="res://assets/lil_guy.png" id="1_rfqfo"] +[ext_resource type="Script" path="res://player_character.gd" id="1_rmbqt"] + +[node name="PlayerCharacter" type="CharacterBody2D"] +script = ExtResource("1_rmbqt") + +[node name="Sprite2D" type="Sprite2D" parent="."] +position = Vector2(-0.5, 3) +scale = Vector2(1.002, 1.008) +texture = ExtResource("1_rfqfo") + +[node name="Camera2D" type="Camera2D" parent="."] + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] +visible = false +position = Vector2(-0.5, 3) +scale = Vector2(1.002, 1.008) +polygon = PackedVector2Array(52, -166.9, 52, -165.3, 63, -160.3, 63, -158.7, 71, -148.7, 71, -145.4, 74, -137.4, 74, -120, 77, -96.1, 77, -78, 82, 49, 80.9, 49, 78.9, 124, 77.5, 124, 74.6, 136, 73, 136, 68, 143, 65.4, 143, 47.4, 150, 40, 150, -60, 149, -60, 147.8, -72, 146.8, -72, 144.7, -79, 136.8, -79, 132.4, -83, 123.4, -83, 121, -80, 56, -80, -49, -80.8, -49, -84, -84.9, -84, -90, -82, -139, -80.5, -139, -78.6, -147, -76.9, -147, -62.8, -160, -60.4, -160, -49.4, -165, -39.4, -165, -26, -167.7, -26, -169.1) diff --git a/game-source/project.godot b/game-source/project.godot index d64f5ba..d939711 100644 --- a/game-source/project.godot +++ b/game-source/project.godot @@ -15,8 +15,36 @@ run/main_scene="res://main.tscn" config/features=PackedStringArray("4.2", "GL Compatibility") config/icon="res://icon.svg" +[input] + +left={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null) +] +} +right={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} +down={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null) +] +} +up={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} + [rendering] +textures/canvas_textures/default_texture_filter=2 renderer/rendering_method="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility" textures/vram_compression/import_etc2_astc=true