-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
129 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
extends Drifter | ||
|
||
# Finds some grass to sleep | ||
onready var sleepTimer_reset = 10 | ||
onready var sleepTimer = 10 | ||
|
||
onready var state = 0 | ||
|
||
func _ready(): | ||
$AnimatedSprite.play('default') | ||
|
||
func evolve(): | ||
tweak() | ||
|
||
func tweak(): | ||
var vibe = world.vibe_nearby(cell); | ||
if vibe.get_grass() < 1: | ||
sleepTimer = sleepTimer_reset | ||
if state != 1: | ||
state = 1 | ||
$AnimatedSprite.play('walk') | ||
var dir = vibiest_dir(DirsOrthogonal,{"Grass":1}) | ||
if dir.x: $AnimatedSprite.flip_h = dir.x<0 | ||
intend_move(dir) | ||
elif sleepTimer > 0: | ||
if state != 0: | ||
state = 0 | ||
$AnimatedSprite.play('default') | ||
sleepTimer -= 1 | ||
elif state != 2: | ||
state = 2 | ||
$AnimatedSprite.play('sleep') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/bluedog.png-8481b873f9fd2973b65cecb312405ba0.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://DriftersUserDefined/friendnard/bluedog.png" | ||
dest_files=[ "res://.import/bluedog.png-8481b873f9fd2973b65cecb312405ba0.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=false | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
process/normal_map_invert_y=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
[gd_scene load_steps=10 format=2] | ||
|
||
[ext_resource path="res://DriftersUserDefined/friendnard/bluedog.png" type="Texture" id=1] | ||
[ext_resource path="res://DriftersUserDefined/friendnard/BlueDog.gd" type="Script" id=2] | ||
|
||
[sub_resource type="AtlasTexture" id=1] | ||
atlas = ExtResource( 1 ) | ||
region = Rect2( 10, 0, 10, 10 ) | ||
|
||
[sub_resource type="AtlasTexture" id=9] | ||
atlas = ExtResource( 1 ) | ||
region = Rect2( 10, 10, 10, 10 ) | ||
|
||
[sub_resource type="AtlasTexture" id=5] | ||
atlas = ExtResource( 1 ) | ||
region = Rect2( 0, 0, 10, 10 ) | ||
|
||
[sub_resource type="AtlasTexture" id=8] | ||
atlas = ExtResource( 1 ) | ||
region = Rect2( 0, 10, 10, 10 ) | ||
|
||
[sub_resource type="AtlasTexture" id=10] | ||
atlas = ExtResource( 1 ) | ||
region = Rect2( 20, 10, 10, 10 ) | ||
|
||
[sub_resource type="AtlasTexture" id=11] | ||
atlas = ExtResource( 1 ) | ||
region = Rect2( 20, 0, 10, 10 ) | ||
|
||
[sub_resource type="SpriteFrames" id=4] | ||
animations = [ { | ||
"frames": [ SubResource( 1 ), SubResource( 9 ) ], | ||
"loop": true, | ||
"name": "default", | ||
"speed": 1.0 | ||
}, { | ||
"frames": [ SubResource( 5 ), SubResource( 8 ) ], | ||
"loop": true, | ||
"name": "walk", | ||
"speed": 5.0 | ||
}, { | ||
"frames": [ SubResource( 10 ), SubResource( 11 ) ], | ||
"loop": true, | ||
"name": "sleep", | ||
"speed": 1.0 | ||
} ] | ||
|
||
[node name="Node2D" type="Node2D"] | ||
script = ExtResource( 2 ) | ||
|
||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."] | ||
frames = SubResource( 4 ) | ||
animation = "sleep" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters