commit f23df0b1f8caca218d7d62b02bd52aa48e8a4623 Author: Ente Date: Fri May 23 10:58:01 2025 +0200 Initial commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0af181c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/android/ diff --git a/assets/icon.svg b/assets/icon.svg new file mode 100644 index 0000000..9d8b7fa --- /dev/null +++ b/assets/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icon.svg.import b/assets/icon.svg.import new file mode 100644 index 0000000..67e75a6 --- /dev/null +++ b/assets/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddd236iwmyh0r" +path="res://.godot/imported/icon.svg-56083ea2a1f1a4f1e49773bdc6d7826c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icon.svg" +dest_files=["res://.godot/imported/icon.svg-56083ea2a1f1a4f1e49773bdc6d7826c.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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/sprites/coin.png b/assets/sprites/coin.png new file mode 100644 index 0000000..01ae33d Binary files /dev/null and b/assets/sprites/coin.png differ diff --git a/assets/sprites/coin.png.import b/assets/sprites/coin.png.import new file mode 100644 index 0000000..cbc97b8 --- /dev/null +++ b/assets/sprites/coin.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://7ih10d2jkw4j" +path="res://.godot/imported/coin.png-c8309bf0f8fb5f3a7d1e96a4eb3f02ce.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/coin.png" +dest_files=["res://.godot/imported/coin.png-c8309bf0f8fb5f3a7d1e96a4eb3f02ce.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/assets/sprites/fruit.png b/assets/sprites/fruit.png new file mode 100644 index 0000000..b9cc7d6 Binary files /dev/null and b/assets/sprites/fruit.png differ diff --git a/assets/sprites/fruit.png.import b/assets/sprites/fruit.png.import new file mode 100644 index 0000000..e94263e --- /dev/null +++ b/assets/sprites/fruit.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cxef30sq7ss80" +path="res://.godot/imported/fruit.png-3735163b668af10c2b35b52cba81b68a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/fruit.png" +dest_files=["res://.godot/imported/fruit.png-3735163b668af10c2b35b52cba81b68a.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/assets/sprites/knight.png b/assets/sprites/knight.png new file mode 100644 index 0000000..5b0eb4f Binary files /dev/null and b/assets/sprites/knight.png differ diff --git a/assets/sprites/knight.png.import b/assets/sprites/knight.png.import new file mode 100644 index 0000000..f9ba3c8 --- /dev/null +++ b/assets/sprites/knight.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bhtcgxo1b0g5p" +path="res://.godot/imported/knight.png-7c67c83d34932624952797d9e971a644.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/knight.png" +dest_files=["res://.godot/imported/knight.png-7c67c83d34932624952797d9e971a644.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/assets/sprites/platforms.png b/assets/sprites/platforms.png new file mode 100644 index 0000000..9be41db Binary files /dev/null and b/assets/sprites/platforms.png differ diff --git a/assets/sprites/platforms.png.import b/assets/sprites/platforms.png.import new file mode 100644 index 0000000..18e9ea9 --- /dev/null +++ b/assets/sprites/platforms.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bjl7pb5j1sf53" +path="res://.godot/imported/platforms.png-3869606db457611ed4193d705dc364e4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/platforms.png" +dest_files=["res://.godot/imported/platforms.png-3869606db457611ed4193d705dc364e4.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/assets/sprites/slime_green.png b/assets/sprites/slime_green.png new file mode 100644 index 0000000..a21cb6f Binary files /dev/null and b/assets/sprites/slime_green.png differ diff --git a/assets/sprites/slime_green.png.import b/assets/sprites/slime_green.png.import new file mode 100644 index 0000000..00d71b1 --- /dev/null +++ b/assets/sprites/slime_green.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bk0e7mjynbqvp" +path="res://.godot/imported/slime_green.png-f6349164bf3a0f5189bb927b97af9c58.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/slime_green.png" +dest_files=["res://.godot/imported/slime_green.png-f6349164bf3a0f5189bb927b97af9c58.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/assets/sprites/slime_purple.png b/assets/sprites/slime_purple.png new file mode 100644 index 0000000..76f564e Binary files /dev/null and b/assets/sprites/slime_purple.png differ diff --git a/assets/sprites/slime_purple.png.import b/assets/sprites/slime_purple.png.import new file mode 100644 index 0000000..1a03830 --- /dev/null +++ b/assets/sprites/slime_purple.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://rnvuj4biex3x" +path="res://.godot/imported/slime_purple.png-26dc5ddef235ce6a400e78e0d532b050.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/slime_purple.png" +dest_files=["res://.godot/imported/slime_purple.png-26dc5ddef235ce6a400e78e0d532b050.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/assets/sprites/world_tileset.png b/assets/sprites/world_tileset.png new file mode 100644 index 0000000..36bbf07 Binary files /dev/null and b/assets/sprites/world_tileset.png differ diff --git a/assets/sprites/world_tileset.png.import b/assets/sprites/world_tileset.png.import new file mode 100644 index 0000000..8d687c8 --- /dev/null +++ b/assets/sprites/world_tileset.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dlbpt0qh2p20n" +path="res://.godot/imported/world_tileset.png-61a32465f33c3d9d3bfecb75b6485009.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/world_tileset.png" +dest_files=["res://.godot/imported/world_tileset.png-61a32465f33c3d9d3bfecb75b6485009.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/project.godot b/project.godot new file mode 100644 index 0000000..9277838 --- /dev/null +++ b/project.godot @@ -0,0 +1,25 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="schmudel_jump" +run/main_scene="uid://df7ey4cfprjit" +config/features=PackedStringArray("4.4", "Forward Plus") +config/icon="res://assets/icon.svg" + +[display] + +window/size/viewport_width=720 +window/size/viewport_height=1080 + +[rendering] + +textures/canvas_textures/default_texture_filter=0 diff --git a/scenes/killzone.tscn b/scenes/killzone.tscn new file mode 100644 index 0000000..2839347 --- /dev/null +++ b/scenes/killzone.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=3 uid="uid://bvnjq1jbeabd4"] + +[ext_resource type="Script" uid="uid://dlx37dl8br661" path="res://scripts/killzone.gd" id="1_xlapc"] + +[node name="Killzone" type="Area2D"] +script = ExtResource("1_xlapc") + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/scenes/level.tscn b/scenes/level.tscn new file mode 100644 index 0000000..61f0ad8 --- /dev/null +++ b/scenes/level.tscn @@ -0,0 +1,27 @@ +[gd_scene load_steps=5 format=3 uid="uid://df7ey4cfprjit"] + +[ext_resource type="PackedScene" uid="uid://07yvalnsoex7" path="res://scenes/player.tscn" id="1_2q6dc"] +[ext_resource type="Script" uid="uid://bpuudy2mj7fjd" path="res://scripts/platform_handler.gd" id="1_w7c3h"] +[ext_resource type="PackedScene" uid="uid://bvnjq1jbeabd4" path="res://scenes/killzone.tscn" id="3_w8frs"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_mx8sn"] +size = Vector2(877, 113) + +[node name="Level" type="Node2D"] + +[node name="PlatformHandler" type="Node" parent="."] +script = ExtResource("1_w7c3h") + +[node name="Camera2D" type="Camera2D" parent="."] +anchor_mode = 0 + +[node name="Player" parent="." instance=ExtResource("1_2q6dc")] +unique_name_in_owner = true +position = Vector2(215, 854) + +[node name="Killzone" parent="." instance=ExtResource("3_w8frs")] +position = Vector2(228, 1267) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Killzone"] +position = Vector2(154, -5) +shape = SubResource("RectangleShape2D_mx8sn") diff --git a/scenes/level.tscn4204592114.tmp b/scenes/level.tscn4204592114.tmp new file mode 100644 index 0000000..1677cc5 --- /dev/null +++ b/scenes/level.tscn4204592114.tmp @@ -0,0 +1,15 @@ +[gd_scene load_steps=3 format=3 uid="uid://df7ey4cfprjit"] + +[ext_resource type="PackedScene" uid="uid://07yvalnsoex7" path="res://scenes/player.tscn" id="1_2q6dc"] +[ext_resource type="Script" uid="uid://bpuudy2mj7fjd" path="res://scripts/platform_handler.gd" id="1_w7c3h"] + +[node name="Level" type="Node2D"] + +[node name="PlatformHandler" type="Node" parent="."] +script = ExtResource("1_w7c3h") + +[node name="Camera2D" type="Camera2D" parent="."] +anchor_mode = 0 + +[node name="Player" parent="." instance=ExtResource("1_2q6dc")] +position = Vector2(354, 464) diff --git a/scenes/level.tscn4212059997.tmp b/scenes/level.tscn4212059997.tmp new file mode 100644 index 0000000..1677cc5 --- /dev/null +++ b/scenes/level.tscn4212059997.tmp @@ -0,0 +1,15 @@ +[gd_scene load_steps=3 format=3 uid="uid://df7ey4cfprjit"] + +[ext_resource type="PackedScene" uid="uid://07yvalnsoex7" path="res://scenes/player.tscn" id="1_2q6dc"] +[ext_resource type="Script" uid="uid://bpuudy2mj7fjd" path="res://scripts/platform_handler.gd" id="1_w7c3h"] + +[node name="Level" type="Node2D"] + +[node name="PlatformHandler" type="Node" parent="."] +script = ExtResource("1_w7c3h") + +[node name="Camera2D" type="Camera2D" parent="."] +anchor_mode = 0 + +[node name="Player" parent="." instance=ExtResource("1_2q6dc")] +position = Vector2(354, 464) diff --git a/scenes/platform.gd b/scenes/platform.gd new file mode 100644 index 0000000..c607387 --- /dev/null +++ b/scenes/platform.gd @@ -0,0 +1,11 @@ +extends AnimatableBody2D + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/scenes/platform.gd.uid b/scenes/platform.gd.uid new file mode 100644 index 0000000..d273deb --- /dev/null +++ b/scenes/platform.gd.uid @@ -0,0 +1 @@ +uid://7trtklxye7up diff --git a/scenes/platform.tscn b/scenes/platform.tscn new file mode 100644 index 0000000..ff43fe0 --- /dev/null +++ b/scenes/platform.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=4 format=3 uid="uid://0851lly0y3wb"] + +[ext_resource type="Texture2D" uid="uid://bjl7pb5j1sf53" path="res://assets/sprites/platforms.png" id="1_ba0x2"] +[ext_resource type="Script" uid="uid://7trtklxye7up" path="res://scenes/platform.gd" id="1_nlgqw"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_ba0x2"] +size = Vector2(32, 9.05475) + +[node name="Platform" type="AnimatableBody2D"] +scale = Vector2(2, 2) +script = ExtResource("1_nlgqw") + +[node name="Sprite2D" type="Sprite2D" parent="."] +position = Vector2(0, -4.5) +texture = ExtResource("1_ba0x2") +region_enabled = true +region_rect = Rect2(16, 0, 32, 9) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, -4.44167) +shape = SubResource("RectangleShape2D_ba0x2") +one_way_collision = true diff --git a/scenes/player.tscn b/scenes/player.tscn new file mode 100644 index 0000000..b3fbc5b --- /dev/null +++ b/scenes/player.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=4 format=3 uid="uid://07yvalnsoex7"] + +[ext_resource type="Texture2D" uid="uid://ddd236iwmyh0r" path="res://assets/icon.svg" id="1_3vyb7"] +[ext_resource type="Script" uid="uid://bgahsyy7gxau4" path="res://scripts/player.gd" id="1_g2els"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_g2els"] +size = Vector2(128, 128) + +[node name="Player" type="CharacterBody2D"] +z_index = 5 +scale = Vector2(0.2, 0.2) +script = ExtResource("1_g2els") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("1_3vyb7") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_g2els") diff --git a/scripts/killzone.gd b/scripts/killzone.gd new file mode 100644 index 0000000..2b890ea --- /dev/null +++ b/scripts/killzone.gd @@ -0,0 +1,15 @@ +extends Area2D + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + + +func _on_body_entered(body: Node2D) -> void: + get_tree().reload_current_scene() diff --git a/scripts/killzone.gd.uid b/scripts/killzone.gd.uid new file mode 100644 index 0000000..891b00c --- /dev/null +++ b/scripts/killzone.gd.uid @@ -0,0 +1 @@ +uid://dlx37dl8br661 diff --git a/scripts/platform_handler.gd b/scripts/platform_handler.gd new file mode 100644 index 0000000..9d43aa8 --- /dev/null +++ b/scripts/platform_handler.gd @@ -0,0 +1,49 @@ +extends Node + +var rng = RandomNumberGenerator.new() +var PlatformScene := preload("res://scenes/platform.tscn") +var platforms := [] +var dead = false +@onready var height: float = get_viewport().size.y +@onready var width: float = get_viewport().size.x +@onready var player: CharacterBody2D = %Player +const N = 10 + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + for i in range(N): + var y = i * height / N + # TODO: don't place platforms where others exist already + place_platform(y) + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + +func _physics_process(delta: float) -> void: + var move = 0 + if player.position.y < height/2 and not dead: + move = height/2 - player.position.y + player.position.y = height/2 + elif player.position.y > height or dead: + dead = true + move = -40 + player.position.y -= 100/2.87 + + + + for platform in platforms: + platform.position.y += move + if platform.position.y > height + platform.get_node("Sprite2D").texture.get_height(): + platform.position = Vector2(rng.randf_range(0, width), 0) + + + + +func place_platform(y: float = 0) -> void: + var platform_instance = PlatformScene.instantiate() + var x = rng.randf_range(0, width) + platform_instance.position = Vector2(x, y) + add_child(platform_instance) + platforms.append(platform_instance) diff --git a/scripts/platform_handler.gd.uid b/scripts/platform_handler.gd.uid new file mode 100644 index 0000000..8f06cdb --- /dev/null +++ b/scripts/platform_handler.gd.uid @@ -0,0 +1 @@ +uid://bpuudy2mj7fjd diff --git a/scripts/player.gd b/scripts/player.gd new file mode 100644 index 0000000..c72f254 --- /dev/null +++ b/scripts/player.gd @@ -0,0 +1,33 @@ +extends CharacterBody2D + + +const SPEED = 300.0 +const JUMP_VELOCITY = -800.0 + +var width + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + width = get_viewport().size.x + velocity.y = JUMP_VELOCITY * 2 + +func _physics_process(delta: float) -> void: + # Add the gravity. + if not is_on_floor(): + velocity += get_gravity() * delta + else: + velocity.y = JUMP_VELOCITY + + # Get the input direction and handle the movement/deceleration. + # As good practice, you should replace UI actions with custom gameplay actions. + var direction := Input.get_axis("ui_left", "ui_right") + if direction: + velocity.x = direction * SPEED + else: + velocity.x = move_toward(velocity.x, 0, SPEED) + + if position.x > width: + position.x -= width + elif position.x < 0: + position.x += width + move_and_slide() diff --git a/scripts/player.gd.uid b/scripts/player.gd.uid new file mode 100644 index 0000000..dddccad --- /dev/null +++ b/scripts/player.gd.uid @@ -0,0 +1 @@ +uid://bgahsyy7gxau4