Camera 2D

This commit is contained in:
MaddoScientisto 2024-03-04 08:25:41 +01:00
commit 4cb902053d
18 changed files with 791 additions and 24 deletions

View file

@ -1,16 +1,18 @@
[gd_scene load_steps=20 format=3 uid="uid://bghghp5ep4w2j"]
[gd_scene load_steps=22 format=3 uid="uid://bghghp5ep4w2j"]
[ext_resource type="Script" path="res://Scripts/PlayerMovement.cs" id="1_m27vu"]
[ext_resource type="Texture2D" uid="uid://la06powu57hu" path="res://Sprites/Cirno_Big.png" id="2_bwf6x"]
[ext_resource type="PackedScene" uid="uid://b1qnfiuokpvsr" path="res://Scenes/bullet.tscn" id="2_ov36d"]
[ext_resource type="Script" path="res://addons/smoothing/smoothing_2d.gd" id="4_j4xhu"]
[ext_resource type="Script" path="res://Scenes/CameraTarget.gd" id="5_cxvyt"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ai4rh"]
size = Vector2(6, 8)
[sub_resource type="AtlasTexture" id="AtlasTexture_omx2u"]
atlas = ExtResource("2_bwf6x")
region = Rect2(0, 0, 8, 16)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ai4rh"]
size = Vector2(6, 8)
[sub_resource type="AtlasTexture" id="AtlasTexture_pdst4"]
atlas = ExtResource("2_bwf6x")
region = Rect2(0, 0, 8, 16)
@ -139,7 +141,19 @@ BulletScene = ExtResource("2_ov36d")
Muzzle = NodePath("Muzzle")
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_ai4rh")
[node name="Muzzle" type="Marker2D" parent="."]
position = Vector2(5, 0)
[node name="Node2D" type="Node2D" parent="."]
[node name="Smoothing2D" type="Node2D" parent="."]
script = ExtResource("4_j4xhu")
flags = 55
[node name="Sprite2D" type="Sprite2D" parent="Smoothing2D"]
visible = false
scale = Vector2(2.5, 1.75)
texture = SubResource("AtlasTexture_omx2u")
@ -147,15 +161,10 @@ hframes = 3
vframes = 4
frame = 1
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_ai4rh")
[node name="CameraTarget" type="Node2D" parent="Smoothing2D"]
script = ExtResource("5_cxvyt")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Smoothing2D"]
y_sort_enabled = true
sprite_frames = SubResource("SpriteFrames_q0rt3")
animation = &"walk_left"
[node name="Muzzle" type="Marker2D" parent="."]
position = Vector2(5, 0)
[node name="Node2D" type="Node2D" parent="."]