Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Flossy Gnu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Purism
Flossy Gnu
Commits
4955be2d
Commit
4955be2d
authored
Mar 15, 2019
by
Nathan Lovato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gnu: Add float animation, particle trail, and particles in the game's bg
parent
152ffcdf
Pipeline
#5072
passed with stage
in 4 minutes and 53 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
180 additions
and
23 deletions
+180
-23
game/Game.tscn
game/Game.tscn
+65
-18
game/Gnu/Gnu.gd
game/Gnu/Gnu.gd
+3
-0
game/Gnu/Gnu.tscn
game/Gnu/Gnu.tscn
+112
-5
No files found.
game/Game.tscn
View file @
4955be2d
[gd_scene load_steps=1
2
format=2]
[gd_scene load_steps=1
8
format=2]
[ext_resource path="res://Game.gd" type="Script" id=1]
[ext_resource path="res://assets/bg.png" type="Texture" id=2]
[ext_resource path="res://ScoreLabel/ScoreLabel.tscn" type="PackedScene" id=3]
[ext_resource path="res://Gnu/Gnu.tscn" type="PackedScene" id=4]
[ext_resource path="res://Foreground.gd" type="Script" id=5]
[ext_resource path="res://PillarSpawner/PillarSpawner.tscn" type="PackedScene" id=6]
[ext_resource path="res://SpriteSpawner/SpriteSpawner.gd" type="Script" id=7]
[ext_resource path="res://SpriteSpawner/GroundSprite.tscn" type="PackedScene" id=8]
[ext_resource path="res://SpriteSpawner/Fence.tscn" type="PackedScene" id=9]
[ext_resource path="res://ScoreBoard/ScoreBoard.tscn" type="PackedScene" id=10]
[ext_resource path="res://assets/particle_cloud_1.png" type="Texture" id=3]
[ext_resource path="res://ScoreLabel/ScoreLabel.tscn" type="PackedScene" id=4]
[ext_resource path="res://Gnu/Gnu.tscn" type="PackedScene" id=5]
[ext_resource path="res://Foreground.gd" type="Script" id=6]
[ext_resource path="res://PillarSpawner/PillarSpawner.tscn" type="PackedScene" id=7]
[ext_resource path="res://SpriteSpawner/SpriteSpawner.gd" type="Script" id=8]
[ext_resource path="res://SpriteSpawner/GroundSprite.tscn" type="PackedScene" id=9]
[ext_resource path="res://SpriteSpawner/Fence.tscn" type="PackedScene" id=10]
[ext_resource path="res://ScoreBoard/ScoreBoard.tscn" type="PackedScene" id=11]
[sub_resource type="Gradient" id=2]
offsets = PoolRealArray( 0, 0.26699, 0.76699, 1 )
colors = PoolColorArray( 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 )
[sub_resource type="GradientTexture" id=3]
gradient = SubResource( 2 )
[sub_resource type="Curve" id=4]
_data = [ Vector2( 0, 0.528988 ), 0.0, 1.40242, 0, 0, Vector2( 0.331339, 0.687388 ), 0.956195, 0.956195, 0, 0, Vector2( 1, 1 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=5]
curve = SubResource( 4 )
[sub_resource type="ParticlesMaterial" id=6]
emission_shape = 2
emission_box_extents = Vector3( 540, 20, 1 )
flag_disable_z = true
spread = 180.0
flatness = 0.32
gravity = Vector3( 0, 40, 0 )
initial_velocity = 57.47
initial_velocity_random = 0.4
angular_velocity = 28.27
angular_velocity_random = 1.0
orbit_velocity = 0.0
orbit_velocity_random = 0.0
damping = 25.29
angle = 310.1
angle_random = 1.0
scale = 0.97
scale_random = 0.39
scale_curve = SubResource( 5 )
color_ramp = SubResource( 3 )
hue_variation_random = 1.0
[sub_resource type="Animation" id=1]
resource_name = "fade_out"
...
...
@@ -37,24 +73,35 @@ layer = -10
texture = ExtResource( 2 )
offset = Vector2( 540, 960 )
[node name="ScoreLabel" parent="Background" instance=ExtResource( 3 )]
[node name="Fog" type="Particles2D" parent="Background"]
modulate = Color( 0.878431, 0.243137, 0.435294, 1 )
position = Vector2( 510, 1540 )
scale = Vector2( 1.31406, 1.31406 )
amount = 40
lifetime = 3.0
preprocess = 2.0
visibility_rect = Rect2( -640, -100.058, 1280, 200 )
process_material = SubResource( 6 )
texture = ExtResource( 3 )
[node name="Gnu" parent="." instance=ExtResource( 4 )]
[node name="ScoreLabel" parent="Background" instance=ExtResource( 4 )]
[node name="Gnu" parent="." instance=ExtResource( 5 )]
position = Vector2( 190, 960 )
z_index = 1
[node name="Foreground" type="Node2D" parent="."]
script = ExtResource(
5
)
script = ExtResource(
6
)
[node name="PillarSpawner" parent="Foreground" instance=ExtResource(
6
)]
[node name="PillarSpawner" parent="Foreground" instance=ExtResource(
7
)]
position = Vector2( 0, 950 )
[node name="GroundSpawner" type="Node2D" parent="Foreground"]
editor/display_folded = true
position = Vector2( -180, 1930 )
z_index = 100
script = ExtResource(
7
)
sprite_scene = ExtResource(
8
)
script = ExtResource(
8
)
sprite_scene = ExtResource(
9
)
[node name="SpawnPosition" type="Position2D" parent="Foreground/GroundSpawner"]
...
...
@@ -62,8 +109,8 @@ sprite_scene = ExtResource( 8 )
editor/display_folded = true
position = Vector2( -180, 1700 )
z_index = 100
script = ExtResource(
7
)
sprite_scene = ExtResource(
9
)
script = ExtResource(
8
)
sprite_scene = ExtResource(
10
)
[node name="SpawnPosition" type="Position2D" parent="Foreground/FenceSpawner"]
...
...
@@ -72,6 +119,6 @@ anims/fade_out = SubResource( 1 )
[node name="UI" type="CanvasLayer" parent="."]
[node name="ScoreBoard" parent="UI" instance=ExtResource( 1
0
)]
[node name="ScoreBoard" parent="UI" instance=ExtResource( 1
1
)]
visible = false
game/Gnu/Gnu.gd
View file @
4955be2d
...
...
@@ -3,6 +3,7 @@ extends KinematicBody2D
signal
died
onready
var
tween
:
Tween
=
$
Tween
onready
var
anim_player
:
AnimationPlayer
=
$
AnimationPlayer
onready
var
sprite
:
Sprite
=
$
Sprite
onready
var
collision_shape
:
CollisionShape2D
=
$
CollisionShape2D
...
...
@@ -28,6 +29,8 @@ func _ready() -> void:
func
set_idle
(
value
)
->
void
:
_idle
=
value
set_physics_process
(
not
value
)
if
not
_idle
:
anim_player
.
play
(
"idle"
)
func
_unhandled_input
(
event
)
->
void
:
...
...
game/Gnu/Gnu.tscn
View file @
4955be2d
[gd_scene load_steps=
5
format=2]
[gd_scene load_steps=
13
format=2]
[ext_resource path="res://Gnu/Gnu.gd" type="Script" id=1]
[ext_resource path="res://Gnu/Camera2D.gd" type="Script" id=2]
[ext_resource path="res://assets/gnu.png" type="Texture" id=3]
[ext_resource path="res://assets/particle_cloud_2.png" type="Texture" id=2]
[ext_resource path="res://Gnu/Camera2D.gd" type="Script" id=3]
[ext_resource path="res://assets/gnu.png" type="Texture" id=4]
[sub_resource type="Gradient" id=4]
offsets = PoolRealArray( 0, 0.199029, 0.830097, 1 )
colors = PoolColorArray( 0.109804, 0.929412, 0.992157, 0, 0.109804, 0.929412, 0.992157, 1, 0.158255, 0.520581, 0.988132, 1, 0.109804, 0.494118, 0.992157, 0 )
[sub_resource type="GradientTexture" id=5]
gradient = SubResource( 4 )
[sub_resource type="Curve" id=6]
_data = [ Vector2( 0, 0.521944 ), 0.0, -0.0460363, 0, 0, Vector2( 0.414574, 0.618744 ), 0.956195, 0.956195, 0, 0, Vector2( 1, 1 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=7]
curve = SubResource( 6 )
[sub_resource type="ParticlesMaterial" id=8]
emission_shape = 1
emission_sphere_radius = 20.0
flag_disable_z = true
flatness = 0.32
gravity = Vector3( 0, -20, 0 )
initial_velocity = -100.0
initial_velocity_random = 0.4
angular_velocity = 20.0
angular_velocity_random = 1.0
orbit_velocity = 0.0
orbit_velocity_random = 0.0
damping = 25.29
angle = 121.2
angle_random = 1.0
scale = 0.8
scale_random = 0.2
scale_curve = SubResource( 7 )
color_ramp = SubResource( 5 )
hue_variation = 0.02
hue_variation_random = 0.35
[sub_resource type="CircleShape2D" id=1]
radius = 55.8274
[sub_resource type="Animation" id=2]
resource_name = "float"
length = 2.0
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.8, 1.6 ),
"transitions": PoolRealArray( 0.435275, 0.965936, 1.36604 ),
"update": 0,
"values": [ Vector2( -66.5, 1 ), Vector2( -69.5, -30 ), Vector2( -68, 20 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:rotation_degrees")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.5, 1.1, 1.7, 1.8, 1.9 ),
"transitions": PoolRealArray( 1, 1.23114, 1, 1, 1 ),
"update": 0,
"values": [ 4.3, -7.0, 1.92708, 2.88061, 2.73285 ]
}
[sub_resource type="Animation" id=3]
resource_name = "idle"
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.001 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( -68.9759, -24.584 ), Vector2( -61.4759, -3.58407 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:rotation_degrees")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.001 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ 4.10578, 0.0 ]
}
[node name="Gnu" type="KinematicBody2D"]
collision_mask = 6
script = ExtResource( 1 )
[node name="PurpleMiasma" type="Particles2D" parent="."]
position = Vector2( -44.9996, 4.58978 )
amount = 10
preprocess = 2.0
local_coords = false
process_material = SubResource( 8 )
texture = ExtResource( 2 )
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2( 250, 0 )
current = true
...
...
@@ -20,13 +121,14 @@ drag_margin_left = 0.0
drag_margin_top = 0.0
drag_margin_right = 0.0
drag_margin_bottom = 0.0
script = ExtResource(
2
)
script = ExtResource(
3
)
[node name="Sprite" type="Sprite" parent="."]
editor/display_folded = true
position = Vector2( -66.5, 1 )
rotation = 0.0522559
scale = Vector2( 0.786026, 0.786026 )
texture = ExtResource(
3
)
texture = ExtResource(
4
)
offset = Vector2( 84.6028, -31.3285 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
...
...
@@ -34,3 +136,8 @@ shape = SubResource( 1 )
[node name="Tween" type="Tween" parent="."]
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "float"
anims/float = SubResource( 2 )
anims/idle = SubResource( 3 )
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment