This commit is contained in:
fram3d 2024-07-08 01:09:29 +02:00
parent 3a88fd7031
commit f77b25d4af
Signed by: fram3d
GPG Key ID: 938920E709EEA32A
4 changed files with 361 additions and 3 deletions

View File

@ -1,12 +1,16 @@
[gd_scene load_steps=24 format=2] [gd_scene load_steps=28 format=2]
[ext_resource path="res://Tilesets/stone.png" type="Texture" id=1] [ext_resource path="res://Tilesets/stone.png" type="Texture" id=1]
[ext_resource path="res://Tilesets/dirt.png" type="Texture" id=2] [ext_resource path="res://Tilesets/dirt.png" type="Texture" id=2]
[ext_resource path="res://Tilesets/water.png" type="Texture" id=3] [ext_resource path="res://Tilesets/water.png" type="Texture" id=3]
[ext_resource path="res://UI/GUI.tscn" type="PackedScene" id=4] [ext_resource path="res://UI/GUI.tscn" type="PackedScene" id=4]
[ext_resource path="res://NPCs/ooze.tscn" type="PackedScene" id=5]
[ext_resource path="res://NPCs/femalegoblin.tscn" type="PackedScene" id=6]
[ext_resource path="res://Audio/Background/cave.ogg" type="AudioStream" id=7] [ext_resource path="res://Audio/Background/cave.ogg" type="AudioStream" id=7]
[ext_resource path="res://camera.gd" type="Script" id=8] [ext_resource path="res://camera.gd" type="Script" id=8]
[ext_resource path="res://NPCs/malegoblin.tscn" type="PackedScene" id=9]
[ext_resource path="res://spawn.gd" type="Script" id=10] [ext_resource path="res://spawn.gd" type="Script" id=10]
[ext_resource path="res://NPCs/moss.tscn" type="PackedScene" id=11]
[sub_resource type="ConvexPolygonShape2D" id=1] [sub_resource type="ConvexPolygonShape2D" id=1]
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 ) points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
@ -247,4 +251,330 @@ autostart = true
script = ExtResource( 10 ) script = ExtResource( 10 )
[node name="GUI" parent="." instance=ExtResource( 4 )] [node name="GUI" parent="." instance=ExtResource( 4 )]
[node name="population" type="Node2D" parent="."]
[node name="goblins" type="Node2D" parent="population"]
[node name="malegoblin" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 68, 60 )
[node name="malegoblin2" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 12, 252 )
[node name="malegoblin3" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 220, 36 )
[node name="malegoblin4" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 252, 12 )
[node name="malegoblin5" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 44, 100 )
[node name="malegoblin6" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 44, 204 )
[node name="malegoblin7" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 252, 60 )
[node name="malegoblin8" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 68, 252 )
[node name="malegoblin9" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 148, 180 )
[node name="malegoblin10" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 20, 20 )
[node name="malegoblin11" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 12, 212 )
[node name="malegoblin12" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 196, 12 )
[node name="malegoblin13" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 196, 60 )
[node name="malegoblin14" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 220, 84 )
[node name="malegoblin15" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 44, 252 )
[node name="malegoblin16" parent="population/goblins" instance=ExtResource( 9 )]
position = Vector2( 172, 244 )
[node name="femalegoblin" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 28, 252 )
[node name="femalegoblin20" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 76, 228 )
[node name="femalegoblin2" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 12, 236 )
[node name="femalegoblin3" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 12, 196 )
[node name="femalegoblin4" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 20, 228 )
[node name="femalegoblin5" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 228, 60 )
[node name="femalegoblin6" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 204, 36 )
[node name="femalegoblin7" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 252, 36 )
[node name="femalegoblin8" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 228, 12 )
[node name="femalegoblin9" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 52, 52 )
[node name="femalegoblin12" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 84, 236 )
[node name="femalegoblin13" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 36, 20 )
[node name="femalegoblin14" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 180, 12 )
[node name="femalegoblin15" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 252, 92 )
[node name="femalegoblin16" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 44, 188 )
[node name="femalegoblin17" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 236, 52 )
[node name="femalegoblin18" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 220, 132 )
[node name="femalegoblin19" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 100, 60 )
[node name="femalegoblin10" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 60, 68 )
[node name="femalegoblin11" parent="population/goblins" instance=ExtResource( 6 )]
position = Vector2( 36, 60 )
[node name="ooze" type="Node2D" parent="population"]
[node name="ooze" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 116, 60 )
[node name="ooze2" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 116, 84 )
[node name="ooze3" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 124, 180 )
[node name="ooze4" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 148, 148 )
[node name="ooze5" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 140, 124 )
[node name="ooze6" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 60, 140 )
[node name="ooze7" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 20, 148 )
[node name="ooze8" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 20, 92 )
[node name="ooze9" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 100, 36 )
[node name="ooze10" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 116, 12 )
[node name="ooze11" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 204, 100 )
[node name="ooze12" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 172, 60 )
[node name="ooze13" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 172, 36 )
[node name="ooze14" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 196, 212 )
[node name="ooze15" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 228, 252 )
[node name="ooze16" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 252, 220 )
[node name="ooze17" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 252, 180 )
[node name="ooze18" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 204, 148 )
[node name="ooze19" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 220, 156 )
[node name="ooze20" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 252, 140 )
[node name="ooze21" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 156, 220 )
[node name="ooze22" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 140, 236 )
[node name="ooze23" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 100, 196 )
[node name="ooze24" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 84, 140 )
[node name="ooze25" parent="population/ooze" instance=ExtResource( 5 )]
position = Vector2( 92, 92 )
[node name="moss" type="Node2D" parent="population"]
[node name="moss" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 132, 28 )
[node name="moss2" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 140, 28 )
[node name="moss3" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 156, 20 )
[node name="moss4" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 140, 60 )
[node name="moss5" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 140, 76 )
[node name="moss6" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 140, 84 )
[node name="moss7" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 132, 92 )
[node name="moss8" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 108, 124 )
[node name="moss9" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 108, 116 )
[node name="moss10" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 124, 108 )
[node name="moss11" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 132, 108 )
[node name="moss12" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 164, 68 )
[node name="moss13" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 180, 68 )
[node name="moss14" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 188, 84 )
[node name="moss15" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 188, 100 )
[node name="moss16" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 188, 116 )
[node name="moss17" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 172, 124 )
[node name="moss18" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 172, 116 )
[node name="moss19" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 108, 140 )
[node name="moss20" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 108, 156 )
[node name="moss21" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 92, 164 )
[node name="moss22" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 76, 164 )
[node name="moss23" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 52, 156 )
[node name="moss24" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 172, 156 )
[node name="moss25" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 172, 140 )
[node name="moss26" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 164, 180 )
[node name="moss27" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 164, 204 )
[node name="moss28" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 164, 188 )
[node name="moss29" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 188, 156 )
[node name="moss30" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 188, 140 )
[node name="moss31" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 204, 164 )
[node name="moss32" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 196, 180 )
[node name="moss33" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 188, 196 )
[node name="moss34" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 212, 196 )
[node name="moss35" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 220, 180 )
[node name="moss36" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 244, 172 )
[node name="moss37" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 236, 180 )
[node name="moss38" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 236, 220 )
[node name="moss39" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 236, 228 )
[node name="moss40" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 220, 228 )
[node name="moss41" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 220, 212 )
[node name="moss42" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 220, 196 )
[node name="moss43" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 180, 220 )
[node name="moss44" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 108, 212 )
[node name="moss45" parent="population/moss" instance=ExtResource( 11 )]
position = Vector2( 28, 164 )
[connection signal="timeout" from="Timer" to="Timer" method="_on_Timer_timeout"] [connection signal="timeout" from="Timer" to="Timer" method="_on_Timer_timeout"]

22
src/export_presets.cfg Normal file
View File

@ -0,0 +1,22 @@
[preset.0]
name="HTML5"
platform="HTML5"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../../game/index.html"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""
[preset.0.options]
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=true
html/custom_html_shell=""
html/head_include=""
custom_template/release=""
custom_template/debug=""

3
src/population.tscn Normal file
View File

@ -0,0 +1,3 @@
[gd_scene format=2]
[node name="population" type="Node2D"]

View File

@ -7,7 +7,7 @@ onready var dirttiles = tilesmap.get_used_cells_by_id(0)
onready var tilesize = tilesmap.tile_set.autotile_get_size(0) onready var tilesize = tilesmap.tile_set.autotile_get_size(0)
onready var watertiles = tilesmap.get_used_cells_by_id(2) onready var watertiles = tilesmap.get_used_cells_by_id(2)
onready var coast = find_coast() var coast = []
const MOVEMENT_VECTORS = [ const MOVEMENT_VECTORS = [
Vector2.UP, Vector2.UP,
@ -16,6 +16,9 @@ const MOVEMENT_VECTORS = [
Vector2.LEFT Vector2.LEFT
] ]
func _ready():
coast = find_coast()
func _on_Timer_timeout(): func _on_Timer_timeout():
var spawner = 0 var spawner = 0
var mossspawner = 0 var mossspawner = 0
@ -24,7 +27,7 @@ func _on_Timer_timeout():
if coast.size() != 0: if coast.size() != 0:
mossspawner = coast[ randi() % coast.size() ] mossspawner = coast[ randi() % coast.size() ]
var random = randi() % 100 var random = randi() % 1000
var mossscene = load("res://NPCs/moss.tscn") var mossscene = load("res://NPCs/moss.tscn")
var mossinstance = mossscene.instance() var mossinstance = mossscene.instance()