-
-
Notifications
You must be signed in to change notification settings - Fork 3
add Squash The Creeps tutorial #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
6326c47
23bf02f
3d581d4
c586349
f8a66c8
0bb88b9
94ce9cd
baac727
003e9c4
655d3af
f999400
f76f2f7
428f5d5
b870d5e
59517c8
9040adb
7ac5706
3e44a68
fc76f1a
be57ec9
118d73d
9f171a2
d3a0686
5678638
3a20114
f5e243a
832f2bd
b965e31
3888ce7
b8a5913
da62a59
fce7a35
789945a
023fe8e
4b2efcd
1165355
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
res://RustScripts.gdextension |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[configuration] | ||
entry_symbol = "gdext_rust_init" | ||
compatibility_minimum = 4.3 | ||
reloadable = true | ||
|
||
[libraries] | ||
linux.debug.x86_64 = "res://../rust/target/debug/libsquash_the_creeps.so" | ||
linux.release.x86_64 = "res://../rust/target/release/libsquash_the_creeps.so" | ||
windows.debug.x86_64 = "res://../rust/target/debug/squash_the_creeps.dll" | ||
windows.release.x86_64 = "res://../rust/target/release/squash_the_creeps.dll" | ||
macos.debug = "res://../rust/target/debug/libsquash_the_creeps.dylib" | ||
macos.release = "res://../rust/target/release/libsquash_the_creeps.dylib" | ||
macos.debug.arm64 = "res://../rust/target/debug/libsquash_the_creeps.dylib" | ||
macos.release.arm64 = "res://../rust/target/release/libsquash_the_creeps.dylib" | ||
web.debug.wasm32 = "res://../rust/target/wasm32-unknown-emscripten/debug/squash_the_creeps.wasm" | ||
web.release.wasm32 = "res://../rust/target/wasm32-unknown-emscripten/release/squash_the_creeps.wasm" | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
uid://7k6rsd6ivfg |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[gd_resource type="AudioBusLayout" format=2] | ||
|
||
[resource] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[gd_resource type="Environment" format=2] | ||
|
||
[resource] | ||
ambient_light_color = Color( 0.341176, 0.341176, 0.466667, 1 ) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Copyright 2011 The Montserrat Project Authors (https://github.com/JulietaUla/Montserrat) | ||
|
||
This Font Software is licensed under the SIL Open Font License, Version 1.1. | ||
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL | ||
|
||
—————————————————————————————- | ||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 | ||
—————————————————————————————- | ||
|
||
PREAMBLE | ||
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. | ||
|
||
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. | ||
|
||
DEFINITIONS | ||
“Font Software” refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. | ||
|
||
“Reserved Font Name” refers to any names specified as such after the copyright statement(s). | ||
|
||
“Original Version” refers to the collection of Font Software components as distributed by the Copyright Holder(s). | ||
|
||
“Modified Version” refers to any derivative made by adding to, deleting, or substituting—in part or in whole—any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. | ||
|
||
“Author” refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. | ||
|
||
PERMISSION & CONDITIONS | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: | ||
|
||
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. | ||
|
||
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. | ||
|
||
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. | ||
|
||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. | ||
|
||
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. | ||
|
||
TERMINATION | ||
This license becomes null and void if any of the above conditions are not met. | ||
|
||
DISCLAIMER | ||
THE FONT SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
[gd_scene load_steps=9 format=3 uid="uid://b70g8epauqibi"] | ||
|
||
[ext_resource type="PackedScene" uid="uid://bvlv4saytitbk" path="res://player.tscn" id="1_ig7tw"] | ||
[ext_resource type="FontFile" uid="uid://dl270v4sovdki" path="res://fonts/Montserrat-Medium.ttf" id="2_0xm2m"] | ||
|
||
[sub_resource type="BoxShape3D" id="BoxShape3D_7dm0k"] | ||
size = Vector3(60, 2, 60) | ||
|
||
[sub_resource type="BoxMesh" id="BoxMesh_ig7tw"] | ||
size = Vector3(60, 2, 60) | ||
|
||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ig7tw"] | ||
albedo_color = Color(0.937816, 0, 0.125279, 1) | ||
|
||
[sub_resource type="CylinderMesh" id="CylinderMesh_0xm2m"] | ||
material = SubResource("StandardMaterial3D_ig7tw") | ||
|
||
[sub_resource type="Curve3D" id="Curve3D_ig7tw"] | ||
closed = true | ||
_data = { | ||
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, -14.9857, 0, -14.0101, 0, 0, 0, 0, 0, 0, 12.0963, 0, -14.9296, 0, 0, 0, 0, 0, 0, 16.9048, 0, 18.8654, 0, 0, 0, 0, 0, 0, -16.1414, 0, 20.7598), | ||
"tilts": PackedFloat32Array(0, 0, 0, 0) | ||
} | ||
point_count = 4 | ||
|
||
[sub_resource type="Theme" id="Theme_h2yge"] | ||
default_font = ExtResource("2_0xm2m") | ||
default_font_size = 22 | ||
|
||
[node name="Main" type="MainScene"] | ||
|
||
[node name="Ground" type="StaticBody3D" parent="."] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0) | ||
collision_layer = 4 | ||
collision_mask = 0 | ||
metadata/_edit_group_ = true | ||
|
||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Ground"] | ||
shape = SubResource("BoxShape3D_7dm0k") | ||
|
||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Ground"] | ||
mesh = SubResource("BoxMesh_ig7tw") | ||
|
||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] | ||
transform = Transform3D(0.25, -0.476727, 0.842752, -0.0669873, 0.85979, 0.506236, -0.965926, -0.183013, 0.183013, 0, 23, 0) | ||
light_energy = 2.293 | ||
light_specular = 2.455 | ||
shadow_enabled = true | ||
directional_shadow_blend_splits = true | ||
|
||
[node name="Player" parent="." instance=ExtResource("1_ig7tw")] | ||
|
||
[node name="Marker3D" type="Marker3D" parent="."] | ||
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 5, 0) | ||
|
||
[node name="Camera3D" type="Camera3D" parent="Marker3D"] | ||
transform = Transform3D(1, 0, 0, 0, 1, -2.98023e-08, 0, 2.98023e-08, 1, 0, -5, 19) | ||
projection = 1 | ||
current = true | ||
size = 19.19 | ||
|
||
[node name="Cylinders" type="Node3D" parent="."] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -18, 0, -14) | ||
|
||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Cylinders"] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0) | ||
mesh = SubResource("CylinderMesh_0xm2m") | ||
|
||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Cylinders"] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 35) | ||
mesh = SubResource("CylinderMesh_0xm2m") | ||
|
||
[node name="MeshInstance3D3" type="MeshInstance3D" parent="Cylinders"] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 35, 0, 33) | ||
mesh = SubResource("CylinderMesh_0xm2m") | ||
|
||
[node name="MeshInstance3D4" type="MeshInstance3D" parent="Cylinders"] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 30, 0, -1) | ||
mesh = SubResource("CylinderMesh_0xm2m") | ||
|
||
[node name="SpawnPath" type="Path3D" parent="."] | ||
curve = SubResource("Curve3D_ig7tw") | ||
|
||
[node name="SpawnLocation" type="PathFollow3D" parent="SpawnPath"] | ||
transform = Transform3D(0.0339328, 0, -0.999424, 0, 1, 0, 0.999424, 0, 0.0339328, -14.9857, 0, -14.0101) | ||
|
||
[node name="MobTimer" type="Timer" parent="."] | ||
wait_time = 0.5 | ||
autostart = true | ||
|
||
[node name="UserInterface" type="UserInterface" parent="."] | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
theme = SubResource("Theme_h2yge") | ||
|
||
[node name="ScoreLabel" type="Label" parent="UserInterface"] | ||
layout_mode = 0 | ||
offset_left = 37.0 | ||
offset_top = 45.0 | ||
offset_right = 98.0 | ||
offset_bottom = 68.0 | ||
theme_override_colors/font_color = Color(0, 0, 0, 1) | ||
text = "Score: 0" | ||
|
||
[node name="Retry" type="ColorRect" parent="UserInterface"] | ||
layout_mode = 1 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
color = Color(0.0705882, 0.121569, 0.152941, 0.380392) | ||
|
||
[node name="Label" type="Label" parent="UserInterface/Retry"] | ||
layout_mode = 1 | ||
anchors_preset = 8 | ||
anchor_left = 0.5 | ||
anchor_top = 0.5 | ||
anchor_right = 0.5 | ||
anchor_bottom = 0.5 | ||
offset_left = -92.5 | ||
offset_top = -14.0 | ||
offset_right = 92.5 | ||
offset_bottom = 14.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
text = "Press enter retry" | ||
|
||
[connection signal="hit" from="Player" to="." method="on_player_hit"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please define all signal connections in Rust code. Some may still need the "manual" API but it's much easier to migrate that, than some scene files. They're also less brittle -- scene connections tend to be messed up when loading with a wrong Godot version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks a lot for those guidelines, and about this, i dont know if i know how to do it exactly (im noob), but anyway, if i dont know tomorrow ill ask |
||
[connection signal="timeout" from="MobTimer" to="." method="on_mob_timer_timeout"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
[gd_scene load_steps=5 format=3 uid="uid://d0jx5lcbm76jf"] | ||
|
||
[ext_resource type="PackedScene" uid="uid://or56hj80wrrn" path="res://art/mob.glb" id="1_dy6sc"] | ||
|
||
[sub_resource type="BoxShape3D" id="BoxShape3D_nokgg"] | ||
size = Vector3(1.40546, 1.45325, 1.70323) | ||
|
||
[sub_resource type="Animation" id="Animation_dy6sc"] | ||
resource_name = "float" | ||
length = 1.2 | ||
loop_mode = 1 | ||
tracks/0/type = "value" | ||
tracks/0/imported = false | ||
tracks/0/enabled = true | ||
tracks/0/path = NodePath("Pivot/Character:position") | ||
tracks/0/interp = 1 | ||
tracks/0/loop_wrap = true | ||
tracks/0/keys = { | ||
"times": PackedFloat32Array(0.3, 0.7), | ||
"transitions": PackedFloat32Array(0.482968, 2), | ||
"update": 0, | ||
"values": [Vector3(0, 0, 0), Vector3(0, 0.65, 0)] | ||
} | ||
tracks/1/type = "value" | ||
tracks/1/imported = false | ||
tracks/1/enabled = true | ||
tracks/1/path = NodePath("Pivot/Character:rotation") | ||
tracks/1/interp = 1 | ||
tracks/1/loop_wrap = true | ||
tracks/1/keys = { | ||
"times": PackedFloat32Array(0.1, 0.5), | ||
"transitions": PackedFloat32Array(0.267943, 1.62451), | ||
"update": 0, | ||
"values": [Vector3(0, 0, 0), Vector3(0.139626, 0, 0)] | ||
} | ||
|
||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_nokgg"] | ||
_data = { | ||
&"float": SubResource("Animation_dy6sc") | ||
} | ||
|
||
[node name="Mob" type="Mob" groups=["mob"]] | ||
collision_layer = 2 | ||
collision_mask = 0 | ||
|
||
[node name="Pivot" type="Node3D" parent="."] | ||
|
||
[node name="Character" parent="Pivot" instance=ExtResource("1_dy6sc")] | ||
transform = Transform3D(1, 0, 0, 0, 0.999408, -0.0344105, 0, 0.0344105, 0.999408, 0, 0.423649, 0) | ||
|
||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0510979, 0.226624, -0.0277531) | ||
shape = SubResource("BoxShape3D_nokgg") | ||
|
||
[node name="VisibleOnScreenNotifier3D" type="VisibleOnScreenNotifier3D" parent="."] | ||
transform = Transform3D(1.55638, 0, 0, 0, 1, 0, 0, 0, 1.86618, 0, 0, 0) | ||
visible = false | ||
aabb = AABB(-0.857277, -1, -1.03447, 1.71455, 2, 2.06894) | ||
|
||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."] | ||
libraries = { | ||
&"": SubResource("AnimationLibrary_nokgg") | ||
} | ||
autoplay = "float" | ||
|
||
[connection signal="screen_exited" from="VisibleOnScreenNotifier3D" to="." method="on_visible_on_screen_notifier_3d_screen_exited"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://bjvmnxjbg7sfm"] | ||
|
||
[ext_resource type="AudioStream" uid="uid://de3ihy6kdsw2x" path="res://art/House In a Forest Loop.ogg" id="1_fvyft"] | ||
|
||
[node name="MusicPlayer" type="AudioStreamPlayer"] | ||
stream = ExtResource("1_fvyft") | ||
autoplay = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
[gd_scene load_steps=7 format=3 uid="uid://bvlv4saytitbk"] | ||
|
||
[ext_resource type="PackedScene" uid="uid://ddyx1ju3dch3p" path="res://art/player.glb" id="1_4flbx"] | ||
|
||
[sub_resource type="SphereShape3D" id="SphereShape3D_onrkg"] | ||
radius = 0.8 | ||
|
||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_4flbx"] | ||
height = 0.264771 | ||
radius = 1.01904 | ||
|
||
[sub_resource type="Animation" id="Animation_onrkg"] | ||
resource_name = "RESET" | ||
length = 0.001 | ||
tracks/0/type = "value" | ||
tracks/0/imported = false | ||
tracks/0/enabled = true | ||
tracks/0/path = NodePath("Pivot/Character:position") | ||
tracks/0/interp = 1 | ||
tracks/0/loop_wrap = true | ||
tracks/0/keys = { | ||
"times": PackedFloat32Array(0), | ||
"transitions": PackedFloat32Array(1), | ||
"update": 0, | ||
"values": [Vector3(0, 0, 0)] | ||
} | ||
tracks/1/type = "value" | ||
tracks/1/imported = false | ||
tracks/1/enabled = true | ||
tracks/1/path = NodePath("Pivot/Character:rotation") | ||
tracks/1/interp = 1 | ||
tracks/1/loop_wrap = true | ||
tracks/1/keys = { | ||
"times": PackedFloat32Array(0), | ||
"transitions": PackedFloat32Array(1), | ||
"update": 0, | ||
"values": [Vector3(0, 0, 0)] | ||
} | ||
|
||
[sub_resource type="Animation" id="Animation_4flbx"] | ||
resource_name = "float" | ||
length = 1.2 | ||
loop_mode = 1 | ||
tracks/0/type = "value" | ||
tracks/0/imported = false | ||
tracks/0/enabled = true | ||
tracks/0/path = NodePath("Pivot/Character:position") | ||
tracks/0/interp = 1 | ||
tracks/0/loop_wrap = true | ||
tracks/0/keys = { | ||
"times": PackedFloat32Array(0.3, 0.7), | ||
"transitions": PackedFloat32Array(0.482968, 2), | ||
"update": 0, | ||
"values": [Vector3(0, 0, 0), Vector3(0, 0.65, 0)] | ||
} | ||
tracks/1/type = "value" | ||
tracks/1/imported = false | ||
tracks/1/enabled = true | ||
tracks/1/path = NodePath("Pivot/Character:rotation") | ||
tracks/1/interp = 1 | ||
tracks/1/loop_wrap = true | ||
tracks/1/keys = { | ||
"times": PackedFloat32Array(0.1, 0.5), | ||
"transitions": PackedFloat32Array(0.267943, 1.62451), | ||
"update": 0, | ||
"values": [Vector3(0, 0, 0), Vector3(0.139626, 0, 0)] | ||
} | ||
|
||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_i3pqv"] | ||
_data = { | ||
&"RESET": SubResource("Animation_onrkg"), | ||
&"float": SubResource("Animation_4flbx") | ||
} | ||
|
||
[node name="Player" type="Player"] | ||
collision_mask = 6 | ||
|
||
[node name="Pivot" type="Node3D" parent="."] | ||
|
||
[node name="Character" parent="Pivot" instance=ExtResource("1_4flbx")] | ||
|
||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.806328, 0) | ||
shape = SubResource("SphereShape3D_onrkg") | ||
|
||
[node name="MobDetector" type="Area3D" parent="."] | ||
collision_layer = 0 | ||
collision_mask = 2 | ||
monitorable = false | ||
|
||
[node name="CollisionShape3D" type="CollisionShape3D" parent="MobDetector"] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.76011, 0) | ||
shape = SubResource("CylinderShape3D_4flbx") | ||
|
||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."] | ||
libraries = { | ||
&"": SubResource("AnimationLibrary_i3pqv") | ||
} | ||
autoplay = "float" | ||
|
||
[connection signal="body_entered" from="MobDetector" to="." method="on_mob_detector_body_entered"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.