mirror of
https://github.com/HarmonyHoney/ROTA.git
synced 2026-07-17 16:46:17 +00:00
face (:
This commit is contained in:
parent
8162a49644
commit
d8fa5b71ee
8 changed files with 20 additions and 7 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 5 KiB |
|
|
@ -41,7 +41,7 @@ tracks/1/keys = {
|
|||
script = ExtResource( 3 )
|
||||
|
||||
[node name="Sprites" type="Node2D" parent="."]
|
||||
scale = Vector2( 0.333, 0.333 )
|
||||
scale = Vector2( 0.25, 0.25 )
|
||||
|
||||
[node name="Rect" type="Sprite" parent="Sprites"]
|
||||
texture = ExtResource( 1 )
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ extends KinematicBody2D
|
|||
class_name Player
|
||||
|
||||
onready var sprite : Sprite = $Sprite
|
||||
onready var face : Sprite = $Sprite/Face
|
||||
onready var hit_area : Area2D = $HitArea
|
||||
onready var push_area : Area2D = $PushArea
|
||||
onready var audio_slap : AudioStreamPlayer2D = $AudioSlap
|
||||
|
|
@ -37,8 +38,10 @@ func _ready():
|
|||
camera = i
|
||||
camera.position = position
|
||||
camera.reset_smoothing()
|
||||
|
||||
camera.connect("set_rotation", self, "set_rotation")
|
||||
break
|
||||
|
||||
|
||||
func rot(arg : Vector2, backwards := false):
|
||||
return arg.rotated(deg2rad((-dir if backwards else dir) * 90))
|
||||
|
||||
|
|
@ -47,9 +50,12 @@ func spin(right := false, repeat := 0):
|
|||
dir += 1 if right else 3
|
||||
camera.target_angle += 90 if right else -90
|
||||
dir %= 4
|
||||
sprite.rotation_degrees = dir * 90
|
||||
#sprite.rotation_degrees = dir * 90
|
||||
update_areas()
|
||||
|
||||
func set_rotation(degrees):
|
||||
face.rotation_degrees = degrees
|
||||
|
||||
func hit_effector(pos : Vector2):
|
||||
move_and_collide(pos - position)
|
||||
velocity = Vector2.ZERO
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
[gd_scene load_steps=9 format=2]
|
||||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://media/image/gobot.png" type="Texture" id=1]
|
||||
[ext_resource path="res://src/actor/Player.gd" type="Script" id=2]
|
||||
[ext_resource path="res://media/audio/sfx/slap0.wav" type="AudioStream" id=3]
|
||||
[ext_resource path="res://media/audio/sfx/player_punch0.wav" type="AudioStream" id=4]
|
||||
[ext_resource path="res://media/image/rect.png" type="Texture" id=5]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 40, 40 )
|
||||
|
|
@ -47,7 +48,10 @@ __meta__ = {
|
|||
}
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
scale = Vector2( 0.267, 0.267 )
|
||||
scale = Vector2( 0.199744, 0.199744 )
|
||||
texture = ExtResource( 5 )
|
||||
|
||||
[node name="Face" type="Sprite" parent="Sprite"]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ extents = Vector2( 49, 49 )
|
|||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
scale = Vector2( 0.333, 0.333 )
|
||||
scale = Vector2( 0.25, 0.25 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="PortalArea" type="Area2D" parent="."]
|
||||
|
|
|
|||
|
|
@ -67,11 +67,14 @@ position = Vector2( 550, 650 )
|
|||
rotation = 3.14159
|
||||
|
||||
[node name="Spike4" parent="Actors" instance=ExtResource( 8 )]
|
||||
position = Vector2( 1350, 950 )
|
||||
position = Vector2( 1550, 950 )
|
||||
|
||||
[node name="Spike5" parent="Actors" instance=ExtResource( 8 )]
|
||||
position = Vector2( 950, 950 )
|
||||
|
||||
[node name="Spike6" parent="Actors" instance=ExtResource( 8 )]
|
||||
position = Vector2( 1450, 950 )
|
||||
|
||||
[node name="Spinner" parent="Actors" instance=ExtResource( 9 )]
|
||||
position = Vector2( 550, -250 )
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue