Start of a new way to camera.
This commit is contained in:
parent
9a9eabd331
commit
0bfe983c87
20
Main.tscn
20
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/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/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/HUD.tscn" type="PackedScene" id=3]
|
||||||
[ext_resource path="res://src/ui/scene_transition.tscn" type="PackedScene" id=4]
|
[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"]
|
[node name="Main" type="Node2D"]
|
||||||
|
|
||||||
|
|
@ -20,3 +24,17 @@ position = Vector2( 112, 56 )
|
||||||
[node name="UI_Layer" parent="." instance=ExtResource( 3 )]
|
[node name="UI_Layer" parent="." instance=ExtResource( 3 )]
|
||||||
|
|
||||||
[node name="MusicPlayer" type="AudioStreamPlayer" parent="."]
|
[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
|
||||||
|
|
|
||||||
15
src/camera_control.gd
Normal file
15
src/camera_control.gd
Normal file
|
|
@ -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))
|
||||||
|
|
@ -77,3 +77,12 @@ __meta__ = {
|
||||||
|
|
||||||
[node name="EnterRight" type="Position2D" parent="." index="7"]
|
[node name="EnterRight" type="Position2D" parent="." index="7"]
|
||||||
position = Vector2( 325, 127 )
|
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 )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user