diff --git a/Main.tscn b/Main.tscn index dacc417..4c8f06a 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,9 +1,13 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://src/actors/players/playerE/PlayerE.tscn" type="PackedScene" id=1] [ext_resource path="res://src/levels/TestBox.tscn" type="PackedScene" id=2] [ext_resource path="res://src/ui/HUD.tscn" type="PackedScene" id=3] [ext_resource path="res://src/ui/scene_transition.tscn" type="PackedScene" id=4] +[ext_resource path="res://src/camera_control.gd" type="Script" id=5] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 160, 90 ) [node name="Main" type="Node2D"] @@ -20,3 +24,17 @@ position = Vector2( 112, 56 ) [node name="UI_Layer" parent="." instance=ExtResource( 3 )] [node name="MusicPlayer" type="AudioStreamPlayer" parent="."] + +[node name="KinematicBody2D" type="KinematicBody2D" parent="."] +position = Vector2( 160, 90 ) +collision_layer = 0 +collision_mask = 256 +script = ExtResource( 5 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="KinematicBody2D"] +visible = false +shape = SubResource( 1 ) + +[node name="Camera2D" type="Camera2D" parent="KinematicBody2D"] +current = true +process_mode = 0 diff --git a/src/camera_control.gd b/src/camera_control.gd new file mode 100644 index 0000000..3dad6f1 --- /dev/null +++ b/src/camera_control.gd @@ -0,0 +1,15 @@ +extends KinematicBody2D + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +func _process(delta): + move_and_slide(Vector2(10,0)) diff --git a/src/levels/TestBox.tscn b/src/levels/TestBox.tscn index a073533..3fed7fa 100644 --- a/src/levels/TestBox.tscn +++ b/src/levels/TestBox.tscn @@ -77,3 +77,12 @@ __meta__ = { [node name="EnterRight" type="Position2D" parent="." index="7"] position = Vector2( 325, 127 ) + +[node name="CameraBounds" type="TileMap" parent="." index="8"] +tile_set = ExtResource( 2 ) +cell_size = Vector2( 16, 16 ) +show_collision = true +collision_layer = 256 +collision_mask = 0 +format = 1 +tile_data = PoolIntArray( -65526, 4, 0, 327679, 4, 0, 262164, 4, 0, 262170, 4, 0, 786444, 4, 0 )