Compare commits

...

1 Commits

Author SHA1 Message Date
Gary Wang
e03b521eef jump dust test, not very happy about the result 2020-11-24 23:16:32 +08:00
3 changed files with 40 additions and 1 deletions

33
JumpDust.tscn Normal file
View File

@ -0,0 +1,33 @@
[gd_scene load_steps=3 format=2]
[sub_resource type="Curve" id=1]
max_value = 100.0
_data = [ Vector2( 0, 83.5227 ), 0.0, -189.877, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="Gradient" id=2]
offsets = PoolRealArray( 0, 0.718841, 1 )
colors = PoolColorArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 )
[node name="CPUParticles2D" type="CPUParticles2D"]
emitting = false
amount = 35
lifetime = 0.25
one_shot = true
explosiveness = 1.0
lifetime_randomness = 0.2
local_coords = false
emission_shape = 2
emission_rect_extents = Vector2( 3, 0 )
direction = Vector2( 0, -1 )
spread = 6.0
gravity = Vector2( 0, 0 )
initial_velocity = 20.0
initial_velocity_random = 0.1
linear_accel = -50.0
linear_accel_random = 1.0
radial_accel = 2.0
radial_accel_random = 0.5
damping = 25.0
damping_random = 1.0
damping_curve = SubResource( 1 )
color_ramp = SubResource( 2 )

View File

@ -30,6 +30,7 @@ var var_jump = 0
onready var sprite = $Sprite
onready var jump_dust = $JumpDust
func _physics_process(delta):
@ -55,6 +56,8 @@ func _physics_process(delta):
coyote_jump_grace = 0
var_jump = VAR_JUMP_TIME
speed.y = JUMP_SPEED
if on_ground:
jump_dust.emitting = true
else:
# Gravity
var mult = 1

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Assets/Player/player.png" type="Texture" id=1]
[ext_resource path="res://Player.gd" type="Script" id=2]
[ext_resource path="res://JumpDust.tscn" type="PackedScene" id=3]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 3, 8 )
@ -16,3 +17,5 @@ texture = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0, -8 )
shape = SubResource( 1 )
[node name="JumpDust" parent="." instance=ExtResource( 3 )]