diff --git a/art/background.png b/art/background.png new file mode 100644 index 0000000..1553ceb Binary files /dev/null and b/art/background.png differ diff --git a/art/background.png.import b/art/background.png.import new file mode 100644 index 0000000..5176b62 --- /dev/null +++ b/art/background.png.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dpdxs6gjmexgh" +path="res://.godot/imported/background.png-694afb2807fe739c9f0954541e14cf0b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/background.png" +dest_files=["res://.godot/imported/background.png-694afb2807fe739c9f0954541e14cf0b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/high_quality_mode=0 +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +mipmaps/preserve_alpha_test_coverage=false +mipmaps/alpha_test_threshold=0.5 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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=0 diff --git a/art/block/block.png b/art/block/block.png index a92cb7d..755d147 100644 Binary files a/art/block/block.png and b/art/block/block.png differ diff --git a/art/block/block.png.import b/art/block/block.png.import index 406d74b..056670b 100644 --- a/art/block/block.png.import +++ b/art/block/block.png.import @@ -40,4 +40,4 @@ 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 +detect_3d/compress_to=0 diff --git a/art/block/portal.png b/art/block/portal.png index 432567a..71e9d88 100644 Binary files a/art/block/portal.png and b/art/block/portal.png differ diff --git a/art/block/portal.png.import b/art/block/portal.png.import index 6a5b1aa..91ed5c6 100644 --- a/art/block/portal.png.import +++ b/art/block/portal.png.import @@ -40,4 +40,4 @@ 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 +detect_3d/compress_to=0 diff --git a/player_2d.gd b/player_2d.gd index 948bf4c..43cd226 100644 --- a/player_2d.gd +++ b/player_2d.gd @@ -1,20 +1,31 @@ extends CharacterBody2D -const SPEED = 400.0 +const SPEED = 380.0 const GRAVITY_MULT = 0.8 const JUMP_VELOCITY = -410.0 -const CAMERA_SMOOTHING_SPEED = 0.5 - var fall_timer = 0.0 var teleport_cooldown = 0 var jumps = 0 +var death_threshold = 1000 func _ready() -> void: pass +func refresh_jump(new_jumps): + if jumps: + jumps = new_jumps + else: + jumps = 1 + teleport_cooldown = 0 + +func on_teleport(): + refresh_jump(1) + teleport_cooldown = 1 + $Camera2D.position_smoothing_enabled = true + func _process(delta: float) -> void: if Input.is_action_just_pressed("jump"): if is_on_floor(): @@ -38,19 +49,28 @@ func _process(delta: float) -> void: velocity.x = direction * SPEED else: velocity.x = move_toward(velocity.x, 0, SPEED) + + print("PLAYER X POSITION: " + str(position.y)) + if position.y >= death_threshold: + print("SLASH KILL") + get_tree().reload_current_scene() fall_timer += 1*delta if is_on_floor(): fall_timer = 0 - jumps = 1 - teleport_cooldown = 0 + refresh_jump(1) + #%Player2D.get_node("Camera2D").position_smoothing_speed = %Player2D.CAMERA_SMOOTHING_SPEED if is_on_wall(): - jumps = 1 - teleport_cooldown = 0 + refresh_jump(1) + #%Player2D.get_node("Camera2D").position_smoothing_speed = %Player2D.CAMERA_SMOOTHING_SPEED - if fall_timer>3: - get_tree().reload_current_scene() + if is_on_ceiling(): + refresh_jump(1) + + if fall_timer > 3: + pass + #get_tree().reload_current_scene() func _physics_process(delta: float) -> void: diff --git a/player_2d.tscn b/player_2d.tscn index 404f261..c5ab5cc 100644 --- a/player_2d.tscn +++ b/player_2d.tscn @@ -2,6 +2,7 @@ [ext_resource type="Script" uid="uid://cojhnj15psd2x" path="res://player_2d.gd" id="1_sy00s"] [ext_resource type="Texture2D" uid="uid://ccxq1fh72bsdk" path="res://art/player.png" id="2_p3026"] +[ext_resource type="Texture2D" uid="uid://dpdxs6gjmexgh" path="res://art/background.png" id="3_p3026"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_fj7yv"] size = Vector2(10, 16) @@ -9,12 +10,21 @@ size = Vector2(10, 16) [node name="Player2D" type="CharacterBody2D" unique_id=889851478] script = ExtResource("1_sy00s") +[node name="Parallax2D" type="Parallax2D" parent="." unique_id=270393374] +repeat_size = Vector2(1, 1) + +[node name="Sprite2D" type="Sprite2D" parent="Parallax2D" unique_id=1267606565] +scale = Vector2(100, 100) +texture = ExtResource("3_p3026") + [node name="Camera2D" type="Camera2D" parent="." unique_id=962368438] zoom = Vector2(1.65, 1.65) +process_callback = 0 position_smoothing_enabled = true -position_smoothing_speed = 0.5 +position_smoothing_speed = 3.0 [node name="Sprite2D" type="Sprite2D" parent="." unique_id=77404965] +texture_filter = 1 texture = ExtResource("2_p3026") [node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1294571021] diff --git a/project.godot b/project.godot index 4b64ef0..42aab52 100644 --- a/project.godot +++ b/project.godot @@ -185,4 +185,5 @@ joypads/ignore_joypad_on_unfocused_application=true [rendering] rendering_device/driver.windows="d3d12" +renderer/rendering_method="gl_compatibility" lights_and_shadows/multi_bounce_occlusion/enabled=true diff --git a/teleporter.gd b/teleporter.gd index 396139c..37acedc 100644 --- a/teleporter.gd +++ b/teleporter.gd @@ -2,6 +2,7 @@ extends Node2D @export var paired_teleporter: String var checked_teleport +var telecam_speed_mult = 4 func _ready() -> void: add_to_group("TELEPORTERS") @@ -20,11 +21,8 @@ func _on_contact(body) -> void: #print("PASSED OVER TELEPORTER") #get_tree().call_group("TELEPORTERS","check_for_pair") for teleporter in get_tree().get_nodes_in_group("TELEPORTERS"): - print("PAIRED" + str(teleporter) + teleporter.paired_teleporter) - print("SELF" + str(self) + teleporter.paired_teleporter) if teleporter != self: if teleporter.paired_teleporter == paired_teleporter and %Player2D.teleport_cooldown == 0: - %Player2D.get_node("Camera2D").position_smoothing_speed = 1 + %Player2D.get_node("Camera2D").position_smoothing_enabled = false body.set_position(teleporter.get_position()) - %Player2D.teleport_cooldown = 1 - %Player2D.get_node("Camera2D").position_smoothing_speed = %Player2D.CAMERA_SMOOTHING_SPEED + %Player2D.on_teleport()