Skip to content

Commit 765edf5

Browse files
committedAug 18, 2019
init commit
0 parents  commit 765edf5

14 files changed

+331
-0
lines changed
 
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/Falcon9.png-18216e77b577f3eb8ea3b62aa010eabc.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://6 Make better games using Curves in Godot/Falcon9.png"
13+
dest_files=[ "res://.import/Falcon9.png-18216e77b577f3eb8ea3b62aa010eabc.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=true
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[gd_scene load_steps=5 format=2]
2+
3+
[sub_resource type="ShaderMaterial" id=1]
4+
5+
[sub_resource type="Gradient" id=2]
6+
offsets = PoolRealArray( 0, 0.22963, 0.459259, 1 )
7+
colors = PoolColorArray( 1, 1, 1, 0.92549, 0.984314, 0.882353, 0.0392157, 0.882353, 0.858824, 0.533333, 0.0705882, 0.854902, 1, 0.0941176, 0, 0.129412 )
8+
9+
[sub_resource type="GradientTexture" id=3]
10+
gradient = SubResource( 2 )
11+
12+
[sub_resource type="ParticlesMaterial" id=4]
13+
emission_shape = 1
14+
emission_sphere_radius = 7.37
15+
flag_disable_z = true
16+
gravity = Vector3( 0, -98, 0 )
17+
angular_velocity = 198.65
18+
angular_velocity_random = 0.18
19+
orbit_velocity = 0.0
20+
orbit_velocity_random = 0.0
21+
linear_accel = 6.9
22+
damping = 6.3
23+
angle = 45.0
24+
angle_random = 1.0
25+
scale = 12.49
26+
color_ramp = SubResource( 3 )
27+
28+
[node name="Fire" type="Particles2D"]
29+
material = SubResource( 1 )
30+
position = Vector2( 360, 360 )
31+
amount = 100
32+
lifetime = 1.5
33+
process_material = SubResource( 4 )
34+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
extends Control
2+
3+
onready var Falcon9 = self.get_node("Falcon9")
4+
onready var Info = self.get_node("Label")
5+
6+
7+
export(float, 0, 1, 0.001) var landedness
8+
export(Curve) var landing_curve
9+
var curve_output
10+
var height
11+
12+
var is_auto_landing = false
13+
var auto_landing_speed = 0.01
14+
15+
16+
func _process(delta):
17+
if is_auto_landing:
18+
self.handle_auto_landing()
19+
20+
self.curve_output = self.landing_curve.interpolate(self.landedness)
21+
22+
23+
self.height = self.curve_output * 426 + 146
24+
25+
26+
self.Falcon9.position.y = self.height
27+
28+
29+
self.update_info_label()
30+
31+
32+
func update_info_label():
33+
var new_text = "Landedness: " + str(self.landedness) + "\n"
34+
new_text += "Curve Output: " + str(self.curve_output) + "\n"
35+
new_text += "Height: " + str(572 - self.height)
36+
self.Info.text = new_text
37+
38+
39+
func handle_auto_landing():
40+
self.landedness += self.auto_landing_speed
41+
if self.landedness >= 1.0:
42+
self.landedness = 1.0
43+
self.is_auto_landing = false
44+
45+
46+
func _on_Button_pressed():
47+
self.is_auto_landing = true
48+
self.landedness = 0.0
49+
50+
51+
func _on_Reset_Button_pressed():
52+
self.landedness = 0.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
[gd_scene load_steps=10 format=2]
2+
3+
[ext_resource path="res://6 Make better games using Curves in Godot/Game.gd" type="Script" id=1]
4+
[ext_resource path="res://6 Make better games using Curves in Godot/landing_curve.tres" type="Curve" id=2]
5+
[ext_resource path="res://6 Make better games using Curves in Godot/Sky.jpg" type="Texture" id=3]
6+
[ext_resource path="res://6 Make better games using Curves in Godot/Falcon9.png" type="Texture" id=4]
7+
[ext_resource path="res://6 Make better games using Curves in Godot/Fire.tscn" type="PackedScene" id=5]
8+
[ext_resource path="res://Fonts/FreeUniversal-Regular.ttf" type="DynamicFontData" id=6]
9+
10+
[sub_resource type="DynamicFont" id=1]
11+
size = 46
12+
font_data = ExtResource( 6 )
13+
14+
[sub_resource type="DynamicFont" id=2]
15+
size = 48
16+
font_data = ExtResource( 6 )
17+
18+
[sub_resource type="DynamicFont" id=3]
19+
size = 48
20+
font_data = ExtResource( 6 )
21+
22+
[node name="Game" type="Control"]
23+
anchor_right = 1.0
24+
anchor_bottom = 1.0
25+
script = ExtResource( 1 )
26+
__meta__ = {
27+
"_edit_use_anchors_": false
28+
}
29+
landing_curve = ExtResource( 2 )
30+
31+
[node name="Sky" type="Sprite" parent="."]
32+
modulate = Color( 0.980392, 0.980392, 0.980392, 1 )
33+
position = Vector2( 505.217, 379.44 )
34+
scale = Vector2( 0.94, 0.66 )
35+
texture = ExtResource( 3 )
36+
37+
[node name="Falcon9" type="Sprite" parent="."]
38+
position = Vector2( 214.42, 146 )
39+
scale = Vector2( 0.5, 0.5 )
40+
texture = ExtResource( 4 )
41+
42+
[node name="Fire" parent="Falcon9" instance=ExtResource( 5 )]
43+
show_behind_parent = true
44+
position = Vector2( -2.33154, 243.119 )
45+
rotation = 3.14159
46+
47+
[node name="Ground" type="ColorRect" parent="."]
48+
margin_left = 108.83
49+
margin_top = 710.0
50+
margin_right = 308.83
51+
margin_bottom = 760.0
52+
color = Color( 0, 0, 0, 1 )
53+
__meta__ = {
54+
"_edit_use_anchors_": false
55+
}
56+
57+
[node name="Label" type="Label" parent="."]
58+
margin_left = 418.995
59+
margin_top = 102.028
60+
margin_right = 498.995
61+
margin_bottom = 162.028
62+
custom_fonts/font = SubResource( 1 )
63+
custom_colors/font_color = Color( 0, 0, 0, 1 )
64+
custom_colors/font_outline_modulate = Color( 1, 1, 1, 1 )
65+
custom_colors/font_color_shadow = Color( 1, 1, 1, 1 )
66+
text = "Info"
67+
68+
[node name="Land_Button" type="Button" parent="."]
69+
margin_left = 418.824
70+
margin_top = 33.1163
71+
margin_right = 652.824
72+
margin_bottom = 99.1163
73+
custom_fonts/font = SubResource( 2 )
74+
text = "Auto Land"
75+
__meta__ = {
76+
"_edit_use_anchors_": false
77+
}
78+
79+
[node name="Reset_Button" type="Button" parent="."]
80+
margin_left = 669.552
81+
margin_top = 33.0
82+
margin_right = 813.552
83+
margin_bottom = 102.0
84+
custom_fonts/font = SubResource( 3 )
85+
text = "Reset"
86+
__meta__ = {
87+
"_edit_use_anchors_": false
88+
}
89+
90+
[connection signal="pressed" from="Land_Button" to="." method="_on_Button_pressed"]
91+
[connection signal="pressed" from="Reset_Button" to="." method="_on_Reset_Button_pressed"]
92+
93+
[editable path="Falcon9/Fire"]
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/Sky.jpg-4150e2aaeab55242ef068f3a28d7f3f5.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://6 Make better games using Curves in Godot/Sky.jpg"
13+
dest_files=[ "res://.import/Sky.jpg-4150e2aaeab55242ef068f3a28d7f3f5.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=true
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[gd_resource type="Curve" format=2]
2+
3+
[resource]
4+
_data = [ Vector2( 0, 0 ), 0.0, 1.4, 0, 0, Vector2( 0.647274, 0.984 ), 0.599765, 0.599765, 0, 0, Vector2( 1, 1 ), 0.0, 0.0, 0, 0 ]
5+

‎Fonts/FreeUniversal-Regular.ttf

35.9 KB
Binary file not shown.

‎LICENSE.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 David E Lipps
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md

Whitespace-only changes.

‎icon.png

4.56 KB
Loading

‎icon.png.import

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://icon.png"
13+
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=true
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0

‎project.godot

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
; Engine configuration file.
2+
; It's best edited using the editor UI and not directly,
3+
; since the parameters that go here are not all obvious.
4+
;
5+
; Format:
6+
; [section] ; section goes between []
7+
; param=value ; assign values to parameters
8+
9+
config_version=4
10+
11+
_global_script_classes=[ ]
12+
_global_script_class_icons={
13+
14+
}
15+
16+
[application]
17+
18+
config/name="Dave the Dev Tutorials"
19+
config/icon="res://icon.png"
20+
21+
[display]
22+
23+
window/size/width=1080
24+
window/size/height=768

0 commit comments

Comments
 (0)
Please sign in to comment.