Skip to content

Commit

Permalink
Merge pull request #69 from gmuGADIG/Justin1L8/camera
Browse files Browse the repository at this point in the history
9/25 Latest Demo
  • Loading branch information
Justin1L8 authored Sep 29, 2024
2 parents 96ff68d + 30e35d1 commit 6a75ef1
Show file tree
Hide file tree
Showing 9 changed files with 169 additions and 32 deletions.
Binary file added demo_art/dungeon_entrance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions demo_art/dungeon_entrance.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dc4pcxr2lfkka"
path="res://.godot/imported/dungeon_entrance.png-468cb136cd351a6f4d7cc6cdb1320a9e.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://demo_art/dungeon_entrance.png"
dest_files=["res://.godot/imported/dungeon_entrance.png-468cb136cd351a6f4d7cc6cdb1320a9e.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
1 change: 1 addition & 0 deletions enemy_spawner/enemy_spawner.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
script = ExtResource("1_pbkwn")

[node name="Timer" type="Timer" parent="."]
wait_time = 10.0
autostart = true

[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
14 changes: 0 additions & 14 deletions latest_demo.tscn

This file was deleted.

6 changes: 6 additions & 0 deletions world/camera/main_cam.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ var _shake_strength := 0.0
func _init() -> void:
instance = self

func _ready() -> void:
global_position = Player.instance.global_position
reset_smoothing()

func _process(delta: float) -> void:
global_position = Player.instance.global_position

_shake_process(delta)

# Should be called every frame. Shakes the camera by changing its [member offset].
Expand Down
1 change: 1 addition & 0 deletions world/camera/main_cam.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ frequency = 0.0079

[node name="MainCam" type="Camera2D"]
position = Vector2(591, 342)
position_smoothing_enabled = true
script = ExtResource("1_36152")
shake_noise = SubResource("FastNoiseLite_chbor")
2 changes: 1 addition & 1 deletion world/environment/pickups/pickup_health.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=5 format=3 uid="uid://bw27nxu2m3rbe"]
[gd_scene load_steps=5 format=3 uid="uid://c3b7wkf6shwp1"]

[ext_resource type="Script" path="res://world/environment/pickups/generic_item_pickup.gd" id="1_28850"]
[ext_resource type="Texture2D" uid="uid://jj82j3q3he5c" path="res://demo_art/tre_test_item.png" id="2_3im74"]
Expand Down
141 changes: 125 additions & 16 deletions world/latest_demo.tscn
Original file line number Diff line number Diff line change
@@ -1,48 +1,157 @@
[gd_scene load_steps=9 format=3 uid="uid://3sqp1m0iowsi"]
[gd_scene load_steps=18 format=3 uid="uid://3sqp1m0iowsi"]

[ext_resource type="PackedScene" uid="uid://uj2rytnj1h4" path="res://enemy/test_enemy/test_enemy.tscn" id="1_h18tn"]
[ext_resource type="PackedScene" uid="uid://c7ck7ril2jix2" path="res://player/player.tscn" id="2_vi53h"]
[ext_resource type="PackedScene" uid="uid://bom8mopkckp5y" path="res://world/environment/chest/chest.tscn" id="3_iuoyy"]
[ext_resource type="PackedScene" uid="uid://bdniv62roo8ov" path="res://world/environment/pickups/item_temp_1.tscn" id="4_05emf"]
[ext_resource type="PackedScene" uid="uid://ct0hhpvj42coh" path="res://world/environment/pickups/item_temp_2.tscn" id="5_xiks4"]
[ext_resource type="PackedScene" path="res://world/environment/pickups/pickup_bomb.tscn" id="4_xhn3s"]
[ext_resource type="PackedScene" uid="uid://ch344rluh4xbs" path="res://world/camera/main_cam.tscn" id="7_7fnsb"]
[ext_resource type="PackedScene" uid="uid://d3xngexqsy6m7" path="res://enemy_spawner/enemy_spawner.tscn" id="7_007xo"]
[ext_resource type="Texture2D" uid="uid://dymucenpxmluo" path="res://icon.svg" id="8_umcft"]
[ext_resource type="PackedScene" uid="uid://cg2jt0166hik8" path="res://world/environment/red_coin/red_coin_manager.tscn" id="9_svfaa"]
[ext_resource type="PackedScene" uid="uid://gp1o7iklljk2" path="res://world/environment/red_coin/red_coin.tscn" id="10_kg0ye"]
[ext_resource type="PackedScene" uid="uid://c3b7wkf6shwp1" path="res://world/environment/pickups/pickup_health.tscn" id="11_4buq1"]
[ext_resource type="PackedScene" uid="uid://dbewnfb1psf22" path="res://world/objects/pushable_block/pushable_block.tscn" id="12_dx3ra"]
[ext_resource type="PackedScene" uid="uid://b5bscusffqp5h" path="res://world/objects/pressure_plate/pressure_plate.tscn" id="13_rhqn7"]
[ext_resource type="Texture2D" uid="uid://dc4pcxr2lfkka" path="res://demo_art/dungeon_entrance.png" id="14_v3o3r"]
[ext_resource type="Script" path="res://world/transition_trigger/transition_trigger.gd" id="15_4y615"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_2fj35"]
size = Vector2(129.5, 126)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_3rema"]
size = Vector2(158, 146)

[node name="LatestDemo" type="Node2D"]

[node name="TestEnemy" parent="." instance=ExtResource("1_h18tn")]
position = Vector2(192, 532)
position = Vector2(351, 619)
max_health = 3

[node name="Player" parent="." instance=ExtResource("2_vi53h")]
position = Vector2(534, 261)

[node name="Chest" parent="." instance=ExtResource("3_iuoyy")]
position = Vector2(155, 234)
loot_table = Array[PackedScene]([ExtResource("4_05emf")])
position = Vector2(147, 44)
loot_table = Array[PackedScene]([ExtResource("4_xhn3s")])

[node name="Chest2" parent="." instance=ExtResource("3_iuoyy")]
position = Vector2(547, 537)
loot_table = Array[PackedScene]([ExtResource("5_xiks4")])
position = Vector2(544, 14)
loot_table = Array[PackedScene]([ExtResource("11_4buq1")])

[node name="ItemTemp1" parent="." instance=ExtResource("4_05emf")]
position = Vector2(1006, 174)

[node name="MainCam" parent="." instance=ExtResource("7_7fnsb")]
position = Vector2(575, 320)
limit_left = -945
limit_top = -220
limit_right = 2030
limit_bottom = 840

[node name="Wall" type="StaticBody2D" parent="."]
[node name="Walls" type="Node2D" parent="."]

[node name="Wall" type="StaticBody2D" parent="Walls"]
z_index = 1
position = Vector2(590, 4)
scale = Vector2(10, 1)
position = Vector2(583, -200)
scale = Vector2(23.3981, 1)
collision_mask = 2

[node name="CollisionShape2D" type="CollisionShape2D" parent="Wall"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/Wall"]
position = Vector2(-1.1, 0)
shape = SubResource("RectangleShape2D_2fj35")

[node name="Sprite2D" type="Sprite2D" parent="Wall"]
[node name="Sprite2D" type="Sprite2D" parent="Walls/Wall"]
texture = ExtResource("8_umcft")

[node name="ItemTemp1" parent="." instance=ExtResource("4_05emf")]
position = Vector2(1006, 174)
[node name="Wall2" type="StaticBody2D" parent="Walls"]
z_index = 1
position = Vector2(583, 830)
scale = Vector2(23.3981, 1)
collision_mask = 2

[node name="MainCam" parent="." instance=ExtResource("7_7fnsb")]
position = Vector2(575, 320)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/Wall2"]
position = Vector2(-1.1, 0)
shape = SubResource("RectangleShape2D_2fj35")

[node name="Sprite2D" type="Sprite2D" parent="Walls/Wall2"]
texture = ExtResource("8_umcft")

[node name="Wall3" type="StaticBody2D" parent="Walls"]
z_index = 1
position = Vector2(-930, 330)
scale = Vector2(0.729347, 9.04527)
collision_mask = 2

[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/Wall3"]
position = Vector2(-1.1, 0)
shape = SubResource("RectangleShape2D_2fj35")

[node name="Sprite2D" type="Sprite2D" parent="Walls/Wall3"]
texture = ExtResource("8_umcft")

[node name="Wall4" type="StaticBody2D" parent="Walls"]
z_index = 1
position = Vector2(2024, 330)
scale = Vector2(0.729347, 9.04527)
collision_mask = 2

[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/Wall4"]
position = Vector2(-1.1, 0)
shape = SubResource("RectangleShape2D_2fj35")

[node name="Sprite2D" type="Sprite2D" parent="Walls/Wall4"]
texture = ExtResource("8_umcft")

[node name="EnemySpawner" parent="." instance=ExtResource("7_007xo")]
position = Vector2(643, 624)

[node name="RedCoinManager" parent="." node_paths=PackedStringArray("reward") instance=ExtResource("9_svfaa")]
position = Vector2(-415, 100)
reward = NodePath("pickup_health")

[node name="RedCoin" parent="RedCoinManager" instance=ExtResource("10_kg0ye")]
position = Vector2(287, 464)

[node name="RedCoin2" parent="RedCoinManager" instance=ExtResource("10_kg0ye")]
position = Vector2(284, -28)

[node name="RedCoin3" parent="RedCoinManager" instance=ExtResource("10_kg0ye")]
position = Vector2(-384, -43)

[node name="RedCoin4" parent="RedCoinManager" instance=ExtResource("10_kg0ye")]
position = Vector2(-375, 460)

[node name="pickup_health" parent="RedCoinManager" instance=ExtResource("11_4buq1")]
position = Vector2(-24, 234)

[node name="PressurePlate" parent="." instance=ExtResource("13_rhqn7")]
position = Vector2(1767, 563)
scale = Vector2(1.84687, 1.84687)

[node name="PushableBlock" parent="." instance=ExtResource("12_dx3ra")]
position = Vector2(1011, 570)
scale = Vector2(2, 2)

[node name="PushableBlock2" parent="." instance=ExtResource("12_dx3ra")]
position = Vector2(1370, 557)
scale = Vector2(2, 2)

[node name="DungeonEntrance" type="Sprite2D" parent="."]
position = Vector2(1699, 24)
scale = Vector2(2.33037, 2.33037)
texture = ExtResource("14_v3o3r")

[node name="TransitionScene" type="Area2D" parent="DungeonEntrance"]
position = Vector2(-6.00761, 27.8925)
scale = Vector2(0.429116, 0.429116)
collision_layer = 0
collision_mask = 2
script = ExtResource("15_4y615")
scene = "uid://rf8m4b5ybrcj"

[node name="CollisionShape2D" type="CollisionShape2D" parent="DungeonEntrance/TransitionScene"]
position = Vector2(6, -13)
shape = SubResource("RectangleShape2D_3rema")

[connection signal="body_entered" from="DungeonEntrance/TransitionScene" to="DungeonEntrance/TransitionScene" method="_on_body_entered"]
2 changes: 1 addition & 1 deletion world/objects/pushable_block/pushable_block.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[sub_resource type="RectangleShape2D" id="RectangleShape2D_c06d2"]

[node name="pushable_block" type="CharacterBody2D"]
[node name="PushableBlock" type="CharacterBody2D"]
disable_mode = 1
collision_mask = 3
motion_mode = 1
Expand Down

0 comments on commit 6a75ef1

Please sign in to comment.