Merge branch 'dev' into Rycarus_Menu

This commit is contained in:
Fabio 2024-08-17 20:45:51 +02:00
commit 0d58464b3e
18 changed files with 245 additions and 36 deletions

BIN
.DS_Store vendored

Binary file not shown.

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=14 format=3 uid="uid://c1sbrwy3s18tf"] [gd_scene load_steps=15 format=3 uid="uid://ba6afuig8bqrg"]
[ext_resource type="PackedScene" uid="uid://snxpqx0ony7s" path="res://objects/Player.tscn" id="1_prjlb"] [ext_resource type="PackedScene" uid="uid://snxpqx0ony7s" path="res://objects/Player.tscn" id="1_prjlb"]
[ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_mxtem"] [ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_mxtem"]
[ext_resource type="Texture2D" uid="uid://cw3onignoce3e" path="res://temp_assets/scale_up.png" id="3_7s458"] [ext_resource type="Texture2D" uid="uid://cw3onignoce3e" path="res://temp_assets/scale_up.png" id="3_7s458"]
[ext_resource type="Script" path="res://scripts/ui_actions.gd" id="3_b82rx"]
[ext_resource type="Texture2D" uid="uid://ckr5hxaqp6s5x" path="res://temp_assets/scale_up_hovered.png" id="4_6s82a"] [ext_resource type="Texture2D" uid="uid://ckr5hxaqp6s5x" path="res://temp_assets/scale_up_hovered.png" id="4_6s82a"]
[ext_resource type="Texture2D" uid="uid://btmck3gpinxo1" path="res://temp_assets/scaled_down.png" id="5_8tyx1"] [ext_resource type="Texture2D" uid="uid://btmck3gpinxo1" path="res://temp_assets/scaled_down.png" id="5_8tyx1"]
[ext_resource type="Texture2D" uid="uid://c02aqv5sgwvgn" path="res://temp_assets/scale_down_hovered.png" id="6_kdplq"] [ext_resource type="Texture2D" uid="uid://c02aqv5sgwvgn" path="res://temp_assets/scale_down_hovered.png" id="6_kdplq"]
@ -32,13 +33,15 @@ visible = false
[node name="UILayer" type="CanvasLayer" parent="."] [node name="UILayer" type="CanvasLayer" parent="."]
[node name="UI" type="Control" parent="UILayer"] [node name="UI" type="Control" parent="UILayer" node_paths=PackedStringArray("player")]
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("3_b82rx")
player = NodePath("../../Player")
[node name="HBoxContainer" type="HBoxContainer" parent="UILayer/UI"] [node name="HBoxContainer" type="HBoxContainer" parent="UILayer/UI"]
layout_mode = 0 layout_mode = 0
@ -73,6 +76,7 @@ texture_focused = ExtResource("8_r6dd1")
[node name="Camera2D" type="Camera2D" parent="."] [node name="Camera2D" type="Camera2D" parent="."]
[node name="Walls" type="StaticBody2D" parent="."] [node name="Walls" type="StaticBody2D" parent="."]
collision_mask = 6
[node name="Ground" type="CollisionShape2D" parent="Walls"] [node name="Ground" type="CollisionShape2D" parent="Walls"]
position = Vector2(0.5, 394.25) position = Vector2(0.5, 394.25)
@ -89,3 +93,7 @@ shape = SubResource("RectangleShape2D_nnio8")
[node name="RightWall" type="CollisionShape2D" parent="Walls"] [node name="RightWall" type="CollisionShape2D" parent="Walls"]
position = Vector2(690, -2.5) position = Vector2(690, -2.5)
shape = SubResource("RectangleShape2D_h7316") shape = SubResource("RectangleShape2D_h7316")
[connection signal="pressed" from="UILayer/UI/HBoxContainer/ScaleUp" to="UILayer/UI" method="select_up"]
[connection signal="pressed" from="UILayer/UI/HBoxContainer/ScaleDown" to="UILayer/UI" method="select_down"]
[connection signal="pressed" from="UILayer/UI/HBoxContainer/TextureButton" to="UILayer/UI" method="select_mirror"]

File diff suppressed because one or more lines are too long

View file

@ -8,7 +8,10 @@ radius = 16.0
height = 32.0 height = 32.0
[node name="EnemyMover" type="CharacterBody2D"] [node name="EnemyMover" type="CharacterBody2D"]
collision_layer = 2
collision_mask = 7
script = ExtResource("1_7kapi") script = ExtResource("1_7kapi")
speed = 75
[node name="Sprite2D" type="Sprite2D" parent="."] [node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_ci3x0") texture = ExtResource("1_ci3x0")

View file

@ -0,0 +1,29 @@
[gd_scene load_steps=5 format=3 uid="uid://d0gpnqknarkg7"]
[ext_resource type="Script" path="res://scripts/goal.gd" id="1_xjaxa"]
[ext_resource type="Texture2D" uid="uid://hsp64ixwg2bb" path="res://temp_assets/goal.png" id="1_y0s3c"]
[ext_resource type="Texture2D" uid="uid://bs8mevd0fornj" path="res://temp_assets/goal_bg.png" id="2_mxvn8"]
[sub_resource type="CircleShape2D" id="CircleShape2D_fjcci"]
radius = 41.0488
[node name="Goal" type="Area2D" node_paths=PackedStringArray("img", "img2")]
scale = Vector2(0.5, 0.5)
collision_layer = 0
collision_mask = 4
script = ExtResource("1_xjaxa")
img = NodePath("GoalImg")
img2 = NodePath("GoalBg")
[node name="GoalBg" type="Sprite2D" parent="."]
z_index = -1
position = Vector2(-4, 0)
texture = ExtResource("2_mxvn8")
[node name="GoalImg" type="Sprite2D" parent="."]
texture = ExtResource("1_y0s3c")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_fjcci")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View file

@ -0,0 +1,15 @@
[gd_scene load_steps=3 format=3 uid="uid://cpa66thuxma15"]
[ext_resource type="Texture2D" uid="uid://hsp64ixwg2bb" path="res://temp_assets/goal.png" id="1_xnjup"]
[ext_resource type="Texture2D" uid="uid://bs8mevd0fornj" path="res://temp_assets/goal_bg.png" id="2_iknpl"]
[node name="MirrorOrb" type="Area2D"]
[node name="Orb" type="Sprite2D" parent="."]
scale = Vector2(0.4, 0.4)
texture = ExtResource("1_xnjup")
[node name="Aura" type="Sprite2D" parent="."]
modulate = Color(1, 1, 1, 0.227451)
z_index = -1
texture = ExtResource("2_iknpl")

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=4 format=3 uid="uid://snxpqx0ony7s"] [gd_scene load_steps=5 format=3 uid="uid://snxpqx0ony7s"]
[ext_resource type="Script" path="res://scripts/player_movement.gd" id="1_a6lhy"] [ext_resource type="Script" path="res://scripts/player_movement.gd" id="1_a6lhy"]
[ext_resource type="Texture2D" uid="uid://qcx482jc7pqr" path="res://textures/player.png" id="2_sscjv"] [ext_resource type="Texture2D" uid="uid://qcx482jc7pqr" path="res://textures/player.png" id="2_sscjv"]
@ -7,9 +7,13 @@
radius = 9.0 radius = 9.0
height = 22.0 height = 22.0
[sub_resource type="CircleShape2D" id="CircleShape2D_vxfel"]
radius = 12.0
[node name="Player" type="CharacterBody2D"] [node name="Player" type="CharacterBody2D"]
collision_layer = 4
collision_mask = 3
script = ExtResource("1_a6lhy") script = ExtResource("1_a6lhy")
jump_count = 1
jump_strength = 600 jump_strength = 600
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
@ -17,3 +21,12 @@ shape = SubResource("CapsuleShape2D_jqi2f")
[node name="Sprite2D" type="Sprite2D" parent="."] [node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_sscjv") texture = ExtResource("2_sscjv")
[node name="Hurtbox" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox"]
shape = SubResource("CircleShape2D_vxfel")
[connection signal="body_entered" from="Hurtbox" to="." method="_on_hurtbox_body_entered"]

View file

@ -11,7 +11,7 @@ config_version=5
[application] [application]
config/name="GMTK_2024" config/name="GMTK_2024"
run/main_scene="res://menu/main_menu/MainMenu.tscn" run/main_scene="res://levels/TestingField.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility") config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://icon.svg" config/icon="res://icon.svg"
@ -45,9 +45,17 @@ click={
] ]
} }
[layer_names]
2d_physics/layer_1="Ground"
2d_physics/layer_2="Enemies"
2d_physics/layer_3="Player"
2d_physics/layer_4="Goal"
[rendering] [rendering]
textures/canvas_textures/default_texture_filter=0 textures/canvas_textures/default_texture_filter=0
renderer/rendering_method="gl_compatibility" renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility"
environment/defaults/default_clear_color=Color(0.785573, 0.700355, 0.83902, 1)
2d/snap/snap_2d_transforms_to_pixel=true 2d/snap/snap_2d_transforms_to_pixel=true

View file

@ -2,8 +2,7 @@ extends CharacterBody2D
@export var speed = 200; @export var speed = 200;
@export var gravity = 50; @export var gravity = 50;
@export var direction = 1;
var direction = 1;
func _physics_process(delta): func _physics_process(delta):

15
gmtk_2024/scripts/goal.gd Normal file
View file

@ -0,0 +1,15 @@
extends Node
@export var next : PackedScene
@export var img : Sprite2D
@export var img2 : Sprite2D
func _process(delta: float) -> void:
img.rotate(2 * delta)
img2.rotate(1 * delta)
func _on_body_entered(body: Node2D) -> void:
get_tree().change_scene_to_packed(next)

View file

@ -1,41 +1,66 @@
extends CharacterBody2D extends CharacterBody2D
@export var speed = 340; @export var speed = 340
@export var gravity = 50; @export var gravity = 50
@export var jump_count = 2; var jump_count = 1
@export var jump_strength = 100 @export var jump_strength = 100
var is_touching_floor : bool = true
var jump_count_current = 2; var jump_buffer_timer : float
var coyote_timer : float = 0.2 # 200 millisecond buffer
var input_direction = 0 #To keep track of which direction we where moving in last frame var input_direction = 0 #To keep track of which direction we where moving in last frame
func get_input(): func get_input(delta):
var left = Input.is_action_pressed("player_left") var left = Input.is_action_pressed("player_left")
var right = Input.is_action_pressed("player_right") var right = Input.is_action_pressed("player_right")
if left and right: if left and right:
input_direction = input_direction input_direction = 0
elif left: elif left:
input_direction = -1 input_direction = -1
elif right: elif right:
input_direction = 1 input_direction = 1
else : else:
input_direction = 0 input_direction = 0
# This line updates the player's velocity
velocity.x = input_direction * speed velocity.x = input_direction * speed
if is_on_floor(): # rest the jump count if is_on_floor():
jump_count_current = jump_count # reset the jump count
is_touching_floor = true
jump_count = 1
coyote_timer = 0.2
if jump_buffer_timer > 0:
Jump()
if Input.is_action_just_pressed("player_jump") and jump_count_current > 0: if not is_on_floor():
velocity.y = -1 * jump_strength if jump_buffer_timer > 0:
jump_count_current = jump_count_current-1 jump_buffer_timer -= delta
elif Input.is_action_pressed("player_jump"): #Fall less fast if we keep holding the button if coyote_timer > 0.0:
coyote_timer -= delta
else:
jump_count = 0
if Input.is_action_just_pressed("player_jump"):
if jump_count > 0:
Jump()
else:
jump_buffer_timer = 0.2 # set a timer to jump again once the player has reached the ground, provided the jump is is still being held down
elif Input.is_action_pressed("player_jump"): #Fall less fast if we keep holding the button
velocity.y += -1 * 25 velocity.y += -1 * 25
func _physics_process(delta): func _physics_process(delta):
get_input() get_input(delta)
velocity.y += gravity velocity.y += gravity
move_and_slide() move_and_slide()
# print(jump_count) # Uncomment for debugging
func Jump():
velocity.y = -1 * jump_strength
jump_count = 0
is_touching_floor = false
func _on_hurtbox_body_entered(body: Node2D) -> void:
get_tree().reload_current_scene()

View file

@ -0,0 +1,34 @@
extends Node
@export var player : CharacterBody2D;
var current_selected = "none";
func _process(delta: float) -> void:
if Input.is_action_just_pressed("click"):
if current_selected == "scale_up":
scale_up()
elif current_selected == "scale_down":
scale_down()
elif current_selected == "mirror":
mirror();
func select_up():
current_selected = "scale_up"
func select_down():
current_selected = "scale_down"
func select_mirror():
current_selected = "mirror"
func scale_up():
pass #Hir hochscalieren einbauen
func scale_down():
pass #Hir runterscalieren einbauen
func mirror():
pass #Hir mirror einbauen einbauen

View file

@ -0,0 +1,9 @@
shader_type canvas_item;
uniform float scroll_speed;
void fragment(){
vec2 shifteduv = UV;
shifteduv .y -= TIME * scroll_speed;
vec4 color = texture(TEXTURE, shifteduv);
COLOR = color;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 3 KiB