Skip to content

Commit

Permalink
Merge branch 'pr9'
Browse files Browse the repository at this point in the history
  • Loading branch information
pancelor committed Nov 21, 2021
2 parents 9108805 + ab6d1bc commit 4182950
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 2 deletions.
32 changes: 32 additions & 0 deletions DriftersUserDefined/friendnard/BlueDog.gd
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')
Binary file added DriftersUserDefined/friendnard/bluedog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions DriftersUserDefined/friendnard/bluedog.png.import
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
53 changes: 53 additions & 0 deletions DriftersUserDefined/friendnard/bluedog.tscn
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"
11 changes: 9 additions & 2 deletions Overhead/MainGardenScene.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=19 format=2]
[gd_scene load_steps=20 format=2]

[ext_resource path="res://navdi2/Node Scripts/NavdiSettings.gd" type="Script" id=1]
[ext_resource path="res://World/GardenWorld.tscn" type="PackedScene" id=2]
Expand All @@ -18,6 +18,7 @@
[ext_resource path="res://DriftersUserDefined/more/Mushroom.tscn" type="PackedScene" id=16]
[ext_resource path="res://DriftersUserDefined/more/Dandelion.tscn" type="PackedScene" id=17]
[ext_resource path="res://DriftersUserDefined/pancelor-demo/Cat.tscn" type="PackedScene" id=18]
[ext_resource path="res://DriftersUserDefined/friendnard/bluedog.tscn" type="PackedScene" id=19]

[node name="MainGardenScene" type="Node2D"]
script = ExtResource( 3 )
Expand All @@ -35,7 +36,13 @@ __meta__ = {

[node name="NavdiSettings" type="Node" parent="."]
script = ExtResource( 1 )
apply_on_click = false
width = 160
height = 144
zoom = 3
fps = 60
project_name = "Gabs_GetWell_Garden"
bg_color = Color( 0, 0, 0, 1 )
UI_stretch_mode = true

[node name="Camera2D" type="Camera2D" parent="."]
Expand All @@ -45,4 +52,4 @@ zoom = Vector2( 0.33, 0.33 )

[node name="GardenWorld" parent="." instance=ExtResource( 2 )]
z_index = 100
spawnables = [ ExtResource( 5 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 12 ), ExtResource( 11 ), ExtResource( 10 ), ExtResource( 18 ), ExtResource( 6 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 4 ) ]
spawnables = [ ExtResource( 5 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 12 ), ExtResource( 11 ), ExtResource( 10 ), ExtResource( 18 ), ExtResource( 6 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 4 ), ExtResource( 19 ) ]

0 comments on commit 4182950

Please sign in to comment.