forked from team-sg/hero-mark-2
adjusted player hitbox
This commit is contained in:
parent
6b1f260c86
commit
55d26ac6ca
9 changed files with 161 additions and 22 deletions
|
@ -0,0 +1,3 @@
|
|||
source_md5="9903ee48c3f91adebb26f59e53f00467"
|
||||
dest_md5="416e355f9219e54fe7fb939c1432e5b4"
|
||||
|
BIN
.import/turniwood.png-129c22553b3d66b3252dfc2c7ecbb083.stex
Normal file
BIN
.import/turniwood.png-129c22553b3d66b3252dfc2c7ecbb083.stex
Normal file
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 282 B |
BIN
graphics/turniwood/turniwood.png
Normal file
BIN
graphics/turniwood/turniwood.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 191 B |
|
@ -2,15 +2,15 @@
|
|||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/monopoly.png-910643831d67dfa2bec184b1ef67b679.stex"
|
||||
path="res://.import/turniwood.png-129c22553b3d66b3252dfc2c7ecbb083.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/npc/monopoly.png"
|
||||
dest_files=[ "res://.import/monopoly.png-910643831d67dfa2bec184b1ef67b679.stex" ]
|
||||
source_file="res://graphics/turniwood/turniwood.png"
|
||||
dest_files=[ "res://.import/turniwood.png-129c22553b3d66b3252dfc2c7ecbb083.stex" ]
|
||||
|
||||
[params]
|
||||
|
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=27 format=2]
|
||||
[gd_scene load_steps=28 format=2]
|
||||
|
||||
[ext_resource path="res://objects/player/player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://graphics/player/sg_walk.png" type="Texture" id=2]
|
||||
|
@ -27,7 +27,10 @@ shader = ExtResource( 13 )
|
|||
shader_param/palette = ExtResource( 8 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=6]
|
||||
extents = Vector2( 4, 7 )
|
||||
extents = Vector2( 2.5, 5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=39]
|
||||
extents = Vector2( 2.5, 5 )
|
||||
|
||||
[sub_resource type="Animation" id=29]
|
||||
resource_name = "climb"
|
||||
|
@ -613,22 +616,21 @@ region_enabled = true
|
|||
region_rect = Rect2( 0, 0, 32, 32 )
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="." groups=["player"]]
|
||||
visible = false
|
||||
position = Vector2( 0, 3 )
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2( 0.5, 2 )
|
||||
shape = SubResource( 6 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." groups=["sword"]]
|
||||
visible = false
|
||||
position = Vector2( 0, 3 )
|
||||
shape = SubResource( 6 )
|
||||
position = Vector2( 0.5, 5 )
|
||||
shape = SubResource( 39 )
|
||||
|
||||
[node name="ClimbRay" type="RayCast2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2( 4, 10 )
|
||||
enabled = true
|
||||
cast_to = Vector2( 0, -14 )
|
||||
cast_to = Vector2( 0, -10 )
|
||||
collision_mask = 4
|
||||
collide_with_areas = true
|
||||
collide_with_bodies = false
|
||||
|
|
13
objects/turniwood/turniwood.gd
Normal file
13
objects/turniwood/turniwood.gd
Normal file
|
@ -0,0 +1,13 @@
|
|||
extends Node2D
|
||||
onready var anims = $AnimationPlayer
|
||||
|
||||
func _ready():
|
||||
#Autostart animationplayer
|
||||
anims.play("idle")
|
||||
|
||||
func _on_AnimationPlayer_animation_finished(anim_name):
|
||||
#When idling is done, turn
|
||||
if anim_name == "idle":
|
||||
anims.play("turn")
|
||||
if anim_name == "turn":
|
||||
anims.play("idle")
|
109
objects/turniwood/turniwood.tscn
Normal file
109
objects/turniwood/turniwood.tscn
Normal file
|
@ -0,0 +1,109 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://objects/turniwood/turniwood.gd" type="Script" id=1]
|
||||
[ext_resource path="res://graphics/turniwood/turniwood.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 4, 1 )
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
resource_name = "idle"
|
||||
step = 0.125
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ false ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Sprite:region_rect")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ Rect2( 0, 0, 8, 8 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("Sprite:rotation_degrees")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0.0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
resource_name = "turn"
|
||||
length = 0.625
|
||||
step = 0.125
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("StaticBody2D/CollisionShape2D:disabled")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.125, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ false, true, false ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Sprite:region_rect")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0, 0.125, 0.25, 0.375, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ Rect2( 0, 0, 8, 8 ), Rect2( 8, 0, 8, 8 ), Rect2( 0, 0, 8, 8 ), Rect2( 8, 0, 8, 8 ), Rect2( 0, 0, 8, 8 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("Sprite:rotation_degrees")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0, 0.125, 0.25, 0.375, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0.0, 90.0, 90.0, 0.0, 0.0 ]
|
||||
}
|
||||
|
||||
[node name="Turniwood" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 4, 4 )
|
||||
texture = ExtResource( 2 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 0, 0, 8, 8 )
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
|
||||
position = Vector2( 4, 4 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
anims/idle = SubResource( 2 )
|
||||
anims/turn = SubResource( 3 )
|
||||
|
||||
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"]
|
Loading…
Add table
Add a link
Reference in a new issue