mirror of
https://github.com/jwinterm/MoonLaunch.git
synced 2026-10-18 05:51:32 +02:00
Added particles
This commit is contained in:
+15
-8
@@ -1,25 +1,32 @@
|
||||
[gd_scene load_steps=5 format=1]
|
||||
[gd_scene load_steps=6 format=1]
|
||||
|
||||
[ext_resource path="res://Level.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Earth.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://Rocket.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://Moon.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://starfield.jpg" type="Texture" id=2]
|
||||
[ext_resource path="res://Earth.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://Rocket.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://Moon.tscn" type="PackedScene" id=5]
|
||||
|
||||
[node name="MoonSpace" type="Node2D"]
|
||||
|
||||
script/script = ExtResource( 1 )
|
||||
|
||||
[node name="Earth" parent="." instance=ExtResource( 2 )]
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
|
||||
texture = ExtResource( 2 )
|
||||
region = true
|
||||
region_rect = Rect2( -5000, -5000, 10000, 10000 )
|
||||
|
||||
[node name="Earth" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
transform/pos = Vector2( 211.028, 755.178 )
|
||||
|
||||
[node name="Rocket" parent="." instance=ExtResource( 3 )]
|
||||
[node name="Rocket" parent="." instance=ExtResource( 4 )]
|
||||
|
||||
transform/pos = Vector2( 433.782, 663.086 )
|
||||
transform/rot = 290.0
|
||||
|
||||
[node name="Moon" parent="." instance=ExtResource( 4 )]
|
||||
[node name="Moon" parent="." instance=ExtResource( 5 )]
|
||||
|
||||
transform/pos = Vector2( 1347.34, 318.09 )
|
||||
transform/pos = Vector2( 1138.31, 163.589 )
|
||||
|
||||
|
||||
|
||||
+37
-6
@@ -1,13 +1,18 @@
|
||||
[gd_scene load_steps=5 format=1]
|
||||
[gd_scene load_steps=6 format=1]
|
||||
|
||||
[ext_resource path="res://rocket.gd" type="Script" id=1]
|
||||
[ext_resource path="res://rocket-297573-800px.png" type="Texture" id=2]
|
||||
[ext_resource path="res://DebugDraw.tscn" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
[sub_resource type="ConvexPolygonShape2D" id=1]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
extents = Vector2( 10, 10 )
|
||||
points = Vector2Array( -11.3815, 0.727529, -10.5982, -4.33918, -6.21178, -8.37972, -0.572069, -11.1376, 5.06765, -8.76453, 9.76742, -4.9164, 10.7074, 0.535122, 5.69428, 9.83478, -6.21178, 9.83478 )
|
||||
|
||||
[sub_resource type="ColorRamp" id=2]
|
||||
|
||||
offsets = FloatArray( 0, 0.502924, 0.994152 )
|
||||
colors = ColorArray( 0.992188, 1, 0, 1, 0.90625, 0.390511, 0.0141602, 1, 0.90625, 0.0106201, 0.0106201, 1 )
|
||||
|
||||
[node name="Rocket" type="RigidBody2D"]
|
||||
|
||||
@@ -37,18 +42,44 @@ __meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="Particles2D" type="Particles2D" parent="."]
|
||||
|
||||
config/amount = 200
|
||||
config/lifetime = 1.2
|
||||
config/process_mode = 1
|
||||
config/offset = Vector2( 0, 20 )
|
||||
params/direction = 0.0
|
||||
params/spread = 30.0
|
||||
params/linear_velocity = 45.0
|
||||
params/spin_velocity = 0.0
|
||||
params/orbit_velocity = 0.0
|
||||
params/gravity_direction = 0.0
|
||||
params/gravity_strength = 9.8
|
||||
params/radial_accel = 0.0
|
||||
params/tangential_accel = 0.0
|
||||
params/damping = 0.0
|
||||
params/initial_angle = 0.0
|
||||
params/initial_size = 1.0
|
||||
params/final_size = 1.03
|
||||
params/hue_variation = 2.0
|
||||
params/anim_speed_scale = 1.0
|
||||
params/anim_initial_pos = 0.0
|
||||
randomness/final_size = 1.0
|
||||
color/color_ramp = SubResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
|
||||
transform/scale = Vector2( 0.1, 0.1 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
[node name="CollisionShape2D" type="CollisionPolygon2D" parent="."]
|
||||
|
||||
transform/pos = Vector2( 0.571488, 1.47728 )
|
||||
transform/scale = Vector2( 1.51812, 3.70819 )
|
||||
shape = SubResource( 1 )
|
||||
build_mode = 0
|
||||
polygon = Vector2Array( -11.3815, 0.727529, -10.5982, -4.33918, -6.21178, -8.37972, -0.572069, -11.1376, 5.06765, -8.76453, 9.76742, -4.9164, 10.7074, 0.535122, 5.69428, 9.83478, -6.21178, 9.83478 )
|
||||
shape_range = Vector2( 0, 0 )
|
||||
trigger = false
|
||||
_update_shape_index = 0
|
||||
|
||||
[node name="debug_draw" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 53 KiB |
@@ -9,9 +9,12 @@ func _ready():
|
||||
func _integrate_forces(state):
|
||||
if Input.is_action_pressed("thrust"):
|
||||
set_applied_force(state.get_total_gravity() - thrust.rotated(get_rot()))
|
||||
get_node("Particles2D").show()
|
||||
elif Input.is_action_pressed("revthrust"):
|
||||
set_applied_force(state.get_total_gravity() + thrust.rotated(get_rot()))
|
||||
get_node("Particles2D").hide()
|
||||
else:
|
||||
set_applied_force(state.get_total_gravity() + Vector2())
|
||||
get_node("Particles2D").hide()
|
||||
var t = Input.is_action_pressed("bear_right") - Input.is_action_pressed("bear_left")
|
||||
set_applied_torque(torque * t)
|
||||
|
||||
Reference in New Issue
Block a user