3 Commits af1c60f58d ... ad5cb5ab25

Author SHA1 Message Date
  [иGogaCoder ad5cb5ab25 Bug fixed. 3 years ago
  [иGogaCoder 58bc775022 Adding camera. 3 years ago
  [иGogaCoder 56c26364f8 Update .gitignore 3 years ago

+ 4 - 0
project/.gitignore

@@ -1,3 +1,7 @@
+# Exclude docs, dolphin cache
+*doctave*/
+.directory
+assets/.directory
 
 # Godot-specific ignores
 .import/

+ 4 - 4
project/assets/Punch/Bullet.tscn

@@ -1,9 +1,9 @@
 [gd_scene load_steps=10 format=2]
 
-[ext_resource path="res://assets/Punch/punch3.png" type="Texture" id=1]
-[ext_resource path="res://assets/Punch/punch2.png" type="Texture" id=2]
-[ext_resource path="res://assets/Punch/punch4.png" type="Texture" id=3]
-[ext_resource path="res://assets/Punch/punch1.png" type="Texture" id=4]
+[ext_resource path="res://assets/Bullet/punch3.png" type="Texture" id=1]
+[ext_resource path="res://assets/Bullet/punch2.png" type="Texture" id=2]
+[ext_resource path="res://assets/Bullet/punch4.png" type="Texture" id=3]
+[ext_resource path="res://assets/Bullet/punch1.png" type="Texture" id=4]
 [ext_resource path="res://scripts/Bullet.gd" type="Script" id=5]
 
 [sub_resource type="RectangleShape2D" id=1]

project/assets/Punch/punch1.png → project/assets/Bullet/punch1.png


project/assets/Punch/punch2.png → project/assets/Bullet/punch2.png


project/assets/Punch/punch3.png → project/assets/Bullet/punch3.png


project/assets/Punch/punch4.png → project/assets/Bullet/punch4.png


+ 15 - 6
project/levels/Level_One.tscn

@@ -51,11 +51,6 @@ extents = Vector2( 19.6767, 23.7101 )
 
 [sub_resource type="SpriteFrames" id=9]
 animations = [ {
-"frames": [ ExtResource( 5 ), ExtResource( 2 ) ],
-"loop": true,
-"name": "Walk",
-"speed": 4.0
-}, {
 "frames": [ ExtResource( 13 ) ],
 "loop": true,
 "name": "SquatIdle",
@@ -80,6 +75,11 @@ animations = [ {
 "loop": true,
 "name": "SquatAction",
 "speed": 5.0
+}, {
+"frames": [ ExtResource( 5 ), ExtResource( 2 ) ],
+"loop": true,
+"name": "Walk",
+"speed": 4.0
 } ]
 
 [sub_resource type="RectangleShape2D" id=10]
@@ -188,7 +188,16 @@ shape = SubResource( 10 )
 disabled = true
 
 [node name="GunPosition" type="Position2D" parent="Player"]
-position = Vector2( 120.829, 48.289 )
+position = Vector2( 120.868, 48.211 )
+
+[node name="Camera2D" type="Camera2D" parent="Player"]
+position = Vector2( 482.261, 30.5855 )
+scale = Vector2( 0.9, 0.5 )
+current = true
+limit_left = 0
+limit_top = 0
+limit_bottom = 1080
+smoothing_enabled = true
 
 [node name="dummy2" type="Sprite" parent="."]
 position = Vector2( 785.746, 374.176 )

+ 1 - 0
project/scripts/Bullet.gd

@@ -11,3 +11,4 @@ func _physics_process(delta):
 
 func _on_VisibilityNotifier2D_screen_exited():
 	queue_free()
+

+ 2 - 2
project/scripts/Player.gd

@@ -16,7 +16,7 @@ const ShiftPower = 2.5 # Shift turbo value
 const SitPower = -150 # Sit down power
 
 # Load Plasma
-const Plasma = preload("res://assets/Punch/Bullet.tscn")
+const Plasma = preload("res://assets/Bullet/Bullet.tscn")
 
 func _ready():
 	Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
@@ -80,7 +80,7 @@ func shot_check():
 	# Shot key proccesing
 	if Input.is_action_pressed("ui_shot") and shot_button_release:
 		var plasma = Plasma.instance()
-		plasma.position.x = $GunPosition.global_position.x/get_parent().screen_scale
+		plasma.position.x = $GunPosition.global_position.x/get_parent().screen_scale 
 		plasma.position.y = $GunPosition.global_position.y/get_parent().screen_scale
 		if $AnimatedSprite.flip_h: # Left player direction
 			plasma.SPEED = -plasma.SPEED