...
 
Commits (2)
.DS_Store
*~
.import/
logs/
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Baeume.png-37849705be448febb2cbcaeba45dae11.stex"
[deps]
source_file="res://Baeume.png"
dest_files=[ "res://.import/Baeume.png-37849705be448febb2cbcaeba45dae11.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=true
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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Baum.png

183 KB

[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Baum.png-78d349528d959be88c05d8d87774c0fd.stex"
[deps]
source_file="res://Baum.png"
dest_files=[ "res://.import/Baum.png-78d349528d959be88c05d8d87774c0fd.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=true
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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Brick.png

294 KB

[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Brick.png-86a2cfd0e3bd8893356a06e9b84aa48c.stex"
[deps]
source_file="res://Brick.png"
dest_files=[ "res://.import/Brick.png-86a2cfd0e3bd8893356a06e9b84aa48c.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=true
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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
File added
extends Camera2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
offset=-get_viewport_rect().size*0.5
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if(((get_parent().get_node("Char").global_position-global_position) /get_viewport_rect().size).x>0.2):
global_position.x+=get_parent().tilesize.x
$Control.rect_position=Vector2(0,0)
get_parent().generate_things(get_parent().currenttile.x+2,get_parent().currenttile.y+1)
get_parent().generate_things(get_parent().currenttile.x+2,get_parent().currenttile.y)
get_parent().generate_things(get_parent().currenttile.x+2,get_parent().currenttile.y-1)
get_parent().currenttile.x+=1
if(((get_parent().get_node("Char").global_position-global_position) /get_viewport_rect().size).x<=-0.2):
global_position.x+=-get_parent().tilesize.x
$Control.rect_position=Vector2(0,0)
get_parent().generate_things(get_parent().currenttile.x-2,get_parent().currenttile.y+1)
get_parent().generate_things(get_parent().currenttile.x-2,get_parent().currenttile.y)
get_parent().generate_things(get_parent().currenttile.x-2,get_parent().currenttile.y-1)
get_parent().currenttile.x-=1
if(((get_parent().get_node("Char").global_position-global_position) /get_viewport_rect().size).y>0.2):
global_position.y+=get_parent().tilesize.y
$Control.rect_position=Vector2(0,0)
get_parent().generate_things(get_parent().currenttile.x-1,get_parent().currenttile.y+2)
get_parent().generate_things(get_parent().currenttile.x,get_parent().currenttile.y+2)
get_parent().generate_things(get_parent().currenttile.x+1,get_parent().currenttile.y+2)
get_parent().currenttile.y+=1
if(((get_parent().get_node("Char").global_position-global_position) /get_viewport_rect().size).y<=-0.2):
global_position.y-=get_parent().tilesize.y
$Control.rect_position=Vector2(0,0)
get_parent().generate_things(get_parent().currenttile.x-1,get_parent().currenttile.y-2)
get_parent().generate_things(get_parent().currenttile.x,get_parent().currenttile.y-2)
get_parent().generate_things(get_parent().currenttile.x+1,get_parent().currenttile.y-2)
get_parent().currenttile.y-=1
pass
extends KinematicBody2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var itemdispblank=preload("res://Item.tscn")
var craftdispblank=preload("res://Craftrecipe.tscn")
var itemImages={}
var speed=Vector2(0,0)
var maxspeed=200
var food = 10
var maxfood = 10
var drink = 10
var maxdrink=10
var ui
var moving=false
var items={}
var itemdisp={}
var craftdisp={}
var fireplace
var watercollector
var fireplaceconstruct=preload("res://Fireplace.tscn")
var watercollectorconstruct=preload("res://Watercollector.tscn")
# Called when the node enters the scene tree for the first time.
func _ready():
var rawmeat=Image.new()
rawmeat.load("res://RawMeat.png")
itemImages["RawMeat"]=rawmeat
var meat=Image.new()
meat.load("res://Meat.png")
itemImages["Meat"]=meat
var drink=Image.new()
drink.load("res://Drink.png")
itemImages["Drink"]=drink
var wood=Image.new()
wood.load("res://Wood.png")
itemImages["Wood"]=wood
var brick=Image.new()
brick.load("res://Brick.png")
itemImages["Brick"]=brick
var shovel=Image.new()
shovel.load("res://Shovel.png")
itemImages["Shovel"]=shovel
fireplace=Image.new()
fireplace.load("res://campfire.png")
watercollector=Image.new()
watercollector.load("res://Watercollector.png")
ui=get_parent().get_node("Camera2D/Control")
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
move_and_collide(delta*speed*maxspeed)
food -=delta*0.1
drink -= delta*0.2
ui.get_node("ProgressBar").value=10*food
ui.get_node("ProgressBar2").value=10*drink
if(!moving and $Character.texture.fps!=0):
$Character.texture.fps=0
if(moving and $Character.texture.fps==0):
$Character.texture.fps=20
if(food<-10 or drink<-10):
get_parent().gameover()
pass
func _input(event):
if event.is_action_pressed("ui_down"):
speed.y=1
elif event.is_action_pressed("ui_up"):
speed.y=-1
if( event.is_action_released("ui_up") or event.is_action_released("ui_down")):
speed.y=0
if event.is_action_pressed("ui_left"):
speed.x=-1
elif event.is_action_pressed("ui_right"):
speed.x=1
if( event.is_action_released("ui_left") or event.is_action_released("ui_right")):
speed.x=0
moving=speed!=Vector2(0,0)
func updateitems():
for item in items.keys():
if !itemdisp.has(item):
var thisItemDisp=itemdispblank.instance()
thisItemDisp.setimg(itemImages[item])
thisItemDisp.get_node("Label").text=str(items[item])
if(item=="RawMeat"):
thisItemDisp.type="rawmeat"
if(item=="Meat"):
thisItemDisp.type="goodfood"
if(item=="Drink"):
thisItemDisp.type="drink"
thisItemDisp.character=self
ui.get_node("VBoxContainer").add_child(thisItemDisp)
itemdisp[item]=thisItemDisp
else:
itemdisp[item].get_node("Label").text=str(items[item])
if(item=="Wood"):
if(items[item]>=5 and !craftdisp.has("Fireplace")):
var thisCraftDisp=craftdispblank.instance()
thisCraftDisp.setimg(fireplace)
thisCraftDisp.type="fireplace"
thisCraftDisp.character=self
thisCraftDisp.additems({"Wood":5})
craftdisp["Fireplace"]=thisCraftDisp
ui.get_node("HBoxContainer").add_child(thisCraftDisp)
if(item=="Brick" and items["Brick"]>=15 and !craftdisp.has("Watercollector")):
var thisCraftDisp=craftdispblank.instance()
thisCraftDisp.setimg(watercollector)
thisCraftDisp.type="watercollector"
thisCraftDisp.character=self
thisCraftDisp.additems({"Brick":15})
craftdisp["Watercollector"]=thisCraftDisp
ui.get_node("HBoxContainer").add_child(thisCraftDisp)
func reduceitem(var name,var amount):
if(items[name]>=amount):
items[name]-=amount
itemdisp[name].get_node("Label").text=str(items[name])
if(items[name]==0):
items.erase(name)
ui.get_node("VBoxContainer").remove_child(itemdisp[name])
itemdisp.erase(name)
if(name=="Wood" and craftdisp.has("Fireplace") and (!items.has("Wood") or items["Wood"]<5)):
ui.get_node("HBoxContainer").remove_child(craftdisp["Fireplace"])
craftdisp.erase("Fireplace")
if(name=="Brick" and craftdisp.has("Watercollector") and (!items.has("Brick") or items["Brick"]<15)):
ui.get_node("HBoxContainer").remove_child(craftdisp["Watercollector"])
craftdisp.erase("Watercollector")
pass
func spawnfireplace():
reduceitem("Wood",5)
var buildplatform=get_parent().get_node("Built")
var thisfire=fireplaceconstruct.instance()
thisfire.position=position
thisfire.player=self
buildplatform.add_child(thisfire)
func spawnwatercollector():
reduceitem("Brick",15)
var buildplatform=get_parent().get_node("Built")
var thiswatercollector=watercollectorconstruct.instance()
thiswatercollector.position=position
thiswatercollector.player=self
buildplatform.add_child(thiswatercollector)
\ No newline at end of file
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Item.gd" type="Script" id=1]
[ext_resource path="res://RawMeat.png" type="Texture" id=2]
[node name="Panel" type="Button"]
margin_right = 120.0
margin_bottom = 40.0
rect_min_size = Vector2( 120, 40 )
script = ExtResource( 1 )
[node name="Texture" type="TextureRect" parent="."]
margin_left = 2.04393
margin_top = 2.0
margin_right = 38.0439
margin_bottom = 38.0
texture = ExtResource( 2 )
expand = true
stretch_mode = 5
[node name="HBoxContainer" type="HBoxContainer" parent="."]
margin_left = 40.0
margin_right = 120.0
margin_bottom = 40.0
[connection signal="pressed" from="." to="." method="_on_Panel_pressed"]
Drink.png

32.9 KB

[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Drink.png-ca2b0479d6b46bd18d5245db76f1b521.stex"
[deps]
source_file="res://Drink.png"
dest_files=[ "res://.import/Drink.png-ca2b0479d6b46bd18d5245db76f1b521.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=true
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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
extends Area2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var player
var meat=0
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if(overlaps_body(player)):
if(Input.is_action_pressed("ui_select")):
if(meat>0):
if(player.items.has("Meat")):
player.items["Meat"]+=meat
else:
player.items["Meat"]=meat
meat=0
player.updateitems()
elif(player.items.has("Wood") and player.items.has("RawMeat")):
if(player.items["RawMeat"]>10):
player.reduceitem("Wood",1)
player.reduceitem("RawMeat",10)
$Timer.start()
$Light2D.visible=true
$Light2D2.visible=true
$Light2D3.visible=true
$Particles2D.visible=true
$Sprite2.visible=true
else:
$Sprite2.visible=false
pass
func _on_Timer_timeout():
meat+=10
$Light2D.visible=false
$Light2D2.visible=false
$Light2D3.visible=false
$Particles2D.visible=false
pass # Replace with function body.
[gd_scene load_steps=10 format=2]
[ext_resource path="res://Fireplace.gd" type="Script" id=1]
[ext_resource path="res://campfire.png" type="Texture" id=2]
[ext_resource path="res://lighttext.png" type="Texture" id=3]
[ext_resource path="res://lighttext_alpha.png" type="Texture" id=4]
[ext_resource path="res://FireplaceShow.png" type="Texture" id=5]
[sub_resource type="CircleShape2D" id=1]
radius = 20.0
[sub_resource type="Gradient" id=2]
offsets = PoolRealArray( 0, 0.0300429, 0.321888, 1 )
colors = PoolColorArray( 0, 0, 0, 1, 1, 0, 0, 1, 1, 0.75, 0, 1, 0, 0, 0, 1 )
[sub_resource type="GradientTexture" id=3]
gradient = SubResource( 2 )
[sub_resource type="ParticlesMaterial" id=4]
emission_shape = 1
emission_sphere_radius = 14.01
flag_disable_z = true
spread = 0.0
gravity = Vector3( 0, -98, 0 )
initial_velocity = 15.61
initial_velocity_random = 0.54
angular_velocity = -108.91
angular_velocity_random = 1.0
orbit_velocity = 0.0
orbit_velocity_random = 0.0
linear_accel = -10.45
linear_accel_random = 0.7
radial_accel = -40.3
radial_accel_random = 0.27
tangential_accel = 34.33
tangential_accel_random = 0.31
angle = 96.7
scale = 0.0
scale_random = 0.6
color_ramp = SubResource( 3 )
hue_variation = 0.1
hue_variation_random = 1.0
anim_speed = 99.61
anim_speed_random = 0.62
[node name="Fireplace" type="Area2D"]
script = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( -2.94441, -10.3054 )
scale = Vector2( 0.1, 0.1 )
texture = ExtResource( 2 )
[node name="Light2D" type="Light2D" parent="."]
visible = false
position = Vector2( 0, 20 )
texture = ExtResource( 3 )
color = Color( 1, 0.843137, 0.541176, 1 )
energy = 0.4
[node name="Light2D2" type="Light2D" parent="."]
visible = false
position = Vector2( 0, 20 )
texture = ExtResource( 3 )
color = Color( 1, 0.494118, 0.298039, 1 )
energy = 0.4
[node name="Light2D3" type="Light2D" parent="."]
visible = false
position = Vector2( 0, 20 )
texture = ExtResource( 3 )
color = Color( 1, 0.968627, 0.909804, 1 )
energy = 0.4
[node name="Particles2D" type="Particles2D" parent="."]
visible = false
position = Vector2( 0, -10 )
amount = 200
speed_scale = 0.54
randomness = 0.48
process_material = SubResource( 4 )
texture = ExtResource( 4 )
[node name="Timer" type="Timer" parent="."]
wait_time = 10.0
one_shot = true
[node name="Sprite2" type="Sprite" parent="."]
visible = false
position = Vector2( 0.307342, -70.9994 )
scale = Vector2( 0.05, 0.05 )
texture = ExtResource( 5 )
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/FireplaceShow.png-38d097dde01022c2212aa51f1f41de04.stex"
[deps]
source_file="res://FireplaceShow.png"
dest_files=[ "res://.import/FireplaceShow.png-38d097dde01022c2212aa51f1f41de04.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=true
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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
extends Node2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var house=preload("res://House.tscn")
var tree=preload("res://Tree.tscn")
var ground=preload("res://Ground.tscn")
var tiles=[Vector2(0,0)]
var currenttile=Vector2(0,0)
var noise
var houses=[]
var trees=[]
var seednum=0
var tilesize
var minutes=0
var raining=false
# Called when the node enters the scene tree for the first time.
func _ready():
tilesize=get_viewport_rect().size*0.6
noise = OpenSimplexNoise.new()
# Configure
seednum=randi()
noise.seed = seednum
noise.octaves = 4
noise.period = 200.0
noise.persistence = 0.8
var treesplanted=0
var housesset=0
randomize()
var actground=ground.instance()
actground.scale=Vector2(tilesize.x/1920,tilesize.y/1080)
$Groundroot.add_child(actground)
generate_things(-1,-1)
generate_things(-1,0)
generate_things(-1,1)
generate_things(0,-1)
generate_things(0,1)
generate_things(1,-1)
generate_things(1,0)
generate_things(1,1)
pass # Replace with function body.
func _process(delta):
minutes+=delta/60
if(global.weather=="raining" and !raining):
$Camera2D/Particles2D.visible=true
modulate=Color(0.6,0.6,0.7)
raining=true
if(global.weather=="sunny" and raining):
$Camera2D/Particles2D.visible=false
modulate=Color(1,1,1)
raining=false
func generate_things(var h,var v):
if(tiles.find(Vector2(h,v))!=-1):
return
var actground=ground.instance()
var noisetex= ImageTexture.new()
var imgnoise=Image.new()
imgnoise.create(int(tilesize.x/100),int(tilesize.y/100),false,Image.FORMAT_RGB8)
imgnoise.lock()
for i in range(int(tilesize.x/100)):
for j in range(int(tilesize.y/100)):
var globalpos=Vector2(h*tilesize.x-(tilesize.x/2)+i*100,v*tilesize.y-(tilesize.y/2)+j*100)
var val=(noise.get_noise_2d(globalpos.x,globalpos.y)+1)/2
var custcolor=Color(val,val,val)
if(val>=0 and val<=1):
imgnoise.set_pixel(i,j,custcolor)
imgnoise.unlock()
imgnoise.resize(1920/10,1080/10,Image.INTERPOLATE_CUBIC)
noisetex.create_from_image(imgnoise)
actground.get_node("Sprite").material.set_shader_param("noise",noisetex)
$Groundroot.add_child(actground)
actground.position=Vector2(h*tilesize.x,v*tilesize.y)
actground.scale=Vector2(tilesize.x/1920,tilesize.y/1080)
for i in range(int(tilesize.x/10)):
for j in range(int(tilesize.y/10)):
var globalpos=Vector2(h*tilesize.x-(tilesize.x/2)+i*10,v*tilesize.y-(tilesize.y/2)+j*10)
var val=noise.get_noise_2d(globalpos.x,globalpos.y)
if(val/(500+100*(abs(h)+abs(v)))>randf()):
var neighbourtooclose=false
for house in houses:
if(abs(globalpos.x-house.x)<36*2 and abs(globalpos.y-house.y)<36*2):
neighbourtooclose=true
print("too close to a house")
break
for tree in trees:
if(abs(globalpos.x-tree.x)<46 and abs(globalpos.y-tree.y)<46):
print("too close to a tree")
neighbourtooclose=true
break
if(!neighbourtooclose):
houses.append(globalpos)
var acthouse=house.instance()
acthouse.player=$Char
$Houseroot.add_child(acthouse)
acthouse.position=globalpos
if(-val/(1500/(500+100*(abs(h)+abs(v))))>randf()):
var actualpos=Vector2(globalpos.x+randf()*5-2.5,globalpos.y+randf()*5-2.5)
var neighbourtooclose=false
for house in houses:
if(abs(globalpos.x-house.x)<46 and abs(globalpos.y-house.y)<46):
neighbourtooclose=true
break
for tree in trees:
if(globalpos.distance_to(tree)<20):
neighbourtooclose=true
break
if(!neighbourtooclose):
trees.append(globalpos)
var acttree=tree.instance()
$Treeroot.add_child(acttree)
acttree.position=actualpos
tiles.append(Vector2(h,v))
func gameover():
self.modulate=Color(1,1,1)
$Camera2D/Control/Gameover.visible=true
$Camera2D/Control/Gameover/Label2.text="Survived"+str(int(minutes))+"Minutes"
self.pause_mode=Node.PAUSE_MODE_STOP
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
[gd_scene load_steps=22 format=2]
[ext_resource path="res://Gamescene.gd" type="Script" id=1]
[ext_resource path="res://Home.gd" type="Script" id=2]
[ext_resource path="res://Haus.png" type="Texture" id=3]
[ext_resource path="res://Lightgen.tscn" type="PackedScene" id=4]
[ext_resource path="res://Char.gd" type="Script" id=5]
[ext_resource path="res://gremlin_0.png" type="Texture" id=6]
[ext_resource path="res://gremlin_1.png" type="Texture" id=7]
[ext_resource path="res://gremlin_2.png" type="Texture" id=8]
[ext_resource path="res://gremlin_3.png" type="Texture" id=9]
[ext_resource path="res://gremlin_4.png" type="Texture" id=10]
[ext_resource path="res://gremlin_5.png" type="Texture" id=11]
[ext_resource path="res://gremlin_6.png" type="Texture" id=12]
[ext_resource path="res://gremlin_7.png" type="Texture" id=13]
[ext_resource path="res://Camera2D.gd" type="Script" id=14]
[ext_resource path="res://Medici Text.ttf" type="DynamicFontData" id=15]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 33.0001, 34.7895 )
[sub_resource type="AnimatedTexture" id=3]
flags = 4
frames = 8
fps = 20.0
frame_0/texture = ExtResource( 6 )
frame_1/texture = ExtResource( 7 )
frame_1/delay_sec = 0.0
frame_2/texture = ExtResource( 8 )
frame_2/delay_sec = 0.0
frame_3/texture = ExtResource( 9 )
frame_3/delay_sec = 0.0
frame_4/texture = ExtResource( 10 )
frame_4/delay_sec = 0.0
frame_5/texture = ExtResource( 11 )
frame_5/delay_sec = 0.0
frame_6/texture = ExtResource( 12 )
frame_6/delay_sec = 0.0
frame_7/texture = ExtResource( 13 )
frame_7/delay_sec = 0.0
[sub_resource type="CircleShape2D" id=2]
[sub_resource type="ParticlesMaterial" id=6]
emission_shape = 2
emission_box_extents = Vector3( 960, 1, 1 )
flag_disable_z = true
spread = 35.6
gravity = Vector3( 0, 98, 0 )
initial_velocity = 179.1
angular_velocity = 505.08
orbit_velocity = 0.0
orbit_velocity_random = 0.0
linear_accel = -100.0
angle = -720.0
color = Color( 0.427451, 0.654902, 1, 0.584314 )
hue_variation = 0.04
hue_variation_random = 1.0
[sub_resource type="DynamicFont" id=4]
size = 120
font_data = ExtResource( 15 )
[sub_resource type="DynamicFont" id=5]
size = 40
font_data = ExtResource( 15 )
[node name="Levelgenerator" type="Node2D"]
script = ExtResource( 1 )
[node name="Groundroot" type="Node2D" parent="."]
[node name="Home" type="Area2D" parent="."]
position = Vector2( 0, -60 )
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="Home"]
position = Vector2( -5.34833, -17.0188 )
scale = Vector2( 0.18, 0.18 )
texture = ExtResource( 3 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Home"]
shape = SubResource( 1 )
[node name="Lightgen" parent="Home" instance=ExtResource( 4 )]
position = Vector2( 0, -0.698334 )
amountLights = 8
[node name="Built" type="Node2D" parent="."]
[node name="Houseroot" type="Node2D" parent="."]
[node name="Treeroot" type="Node2D" parent="."]
[node name="Char" type="KinematicBody2D" parent="."]
script = ExtResource( 5 )
[node name="Character" type="Sprite" parent="Char"]
position = Vector2( 0.0342946, -17.7901 )
scale = Vector2( 0.03, 0.03 )
texture = SubResource( 3 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Char"]
shape = SubResource( 2 )
[node name="Camera2D" type="Camera2D" parent="."]
offset = Vector2( -512, -300 )
anchor_mode = 0
current = true
drag_margin_h_enabled = false
drag_margin_v_enabled = false
script = ExtResource( 14 )
[node name="Particles2D" type="Particles2D" parent="Camera2D"]
visible = false
position = Vector2( 0, -540 )
amount = 5000
lifetime = 10.0
speed_scale = 18.97
randomness = 1.0
visibility_rect = Rect2( -100, -100, 200, 1080 )
process_material = SubResource( 6 )
[node name="Control" type="Control" parent="Camera2D"]
margin_right = 40.0
margin_bottom = 40.0
[node name="ProgressBar" type="ProgressBar" parent="Camera2D/Control"]
modulate = Color( 0.854902, 0.462745, 0.462745, 1 )
margin_left = -479.619
margin_top = 245.204
margin_right = -310.619
margin_bottom = 259.204
rect_pivot_offset = Vector2( 84.5, 7 )
percent_visible = false
[node name="ProgressBar2" type="ProgressBar" parent="Camera2D/Control"]
modulate = Color( 0.462745, 0.541176, 0.854902, 1 )
margin_left = -480.016
margin_top = 262.681
margin_right = -311.016
margin_bottom = 276.681
rect_pivot_offset = Vector2( 84.5, 7 )
percent_visible = false
[node name="VBoxContainer" type="VBoxContainer" parent="Camera2D/Control"]
margin_left = -494.0
margin_top = -280.0
margin_right = -378.0
margin_bottom = -1.0
rect_min_size = Vector2( 0, 40 )
[node name="HBoxContainer" type="HBoxContainer" parent="Camera2D/Control"]
margin_left = -240.0
margin_top = 240.0
margin_right = 494.0
margin_bottom = 280.0
alignment = 2
[node name="Gameover" type="ColorRect" parent="Camera2D/Control"]
visible = false
margin_left = -514.0
margin_top = -302.0
margin_right = 515.0
margin_bottom = 300.0
color = Color( 0, 0, 0, 0.643137 )
[node name="Label" type="Label" parent="Camera2D/Control/Gameover"]
margin_left = 265.273
margin_top = 172.767
margin_right = 768.273
margin_bottom = 283.767
custom_fonts/font = SubResource( 4 )
text = "Game Over"
[node name="Label2" type="Label" parent="Camera2D/Control/Gameover"]
margin_left = 266.633
margin_top = 310.165
margin_right = 769.633
margin_bottom = 421.165
custom_fonts/font = SubResource( 5 )
text = "Survived 0 Minutes"
align = 1
File added
Gras.png

2.86 MB

[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/Gras.png-f7cc95b214130dc2742e08f26b6afae2.s3tc.stex"
path.etc2="res://.import/Gras.png-f7cc95b214130dc2742e08f26b6afae2.etc2.stex"
[deps]
source_file="res://Gras.png"
dest_files=[ "res://.import/Gras.png-f7cc95b214130dc2742e08f26b6afae2.s3tc.stex", "res://.import/Gras.png-f7cc95b214130dc2742e08f26b6afae2.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Noisetextblending.tres" type="Material" id=1]
[ext_resource path="res://Schlamm.png" type="Texture" id=2]
[node name="Ground" type="Node2D"]
[node name="Sprite" type="Sprite" parent="."]
material = ExtResource( 1 )
texture = ExtResource( 2 )
Haus.png

285 KB

[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Haus.png-c89531e796f1638dc2a304d3aa447536.stex"
[deps]
source_file="res://Haus.png"
dest_files=[ "res://.import/Haus.png-c89531e796f1638dc2a304d3aa447536.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=true
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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
extends Area2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var character
# Called when the node enters the scene tree for the first time.
func _ready():
character=get_parent().get_node("Char")
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
extends Area2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var player
var item={}
# Called when the node enters the scene tree for the first time.
func _ready():
if(randf()>0.6):
item["RawMeat"]=(randi()%4)*10+10
if(randf()>0.2):
item["Wood"]=(randi()%4)+1
if(randf()>0.7):
item["Brick"]=(randi()%3)+1
if(randf()>0.3):
item["Drink"]=(randi()%4)*10+10
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if(overlaps_body(player)):
if(Input.is_action_pressed("ui_select")):
for i in item.keys():
if(player.items.has(i)):
player.items[i]+=item[i]
else:
player.items[i]=item[i]
item.erase(i)
player.updateitems()
$icon/Lightgen.visible=true
pass
[gd_scene load_steps=5 format=2]
[ext_resource path="res://House.gd" type="Script" id=1]
[ext_resource path="res://Haus.png" type="Texture" id=2]
[ext_resource path="res://Lightgen.tscn" type="PackedScene" id=3]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 36, 36 )
[node name="House" type="Area2D"]
script = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[node name="icon" type="Sprite" parent="."]
position = Vector2( -3.4449, -13.9724 )
scale = Vector2( 0.14, 0.14 )
texture = ExtResource( 2 )
[node name="Lightgen" parent="icon" instance=ExtResource( 3 )]
visible = false
amountLights = 4
extends Button
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var type
var character
var cost
var fontinf=preload("res://font.tres")
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func setimg(var img):
var imgtexture=ImageTexture.new()
imgtexture.create_from_image(img)
$Texture.texture=imgtexture
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func additems(var dict):
cost=dict
for item in dict.keys():
var imgtext=ImageTexture.new()
imgtext.create_from_image(character.itemImages[item])
var imgrect=TextureRect.new()
imgrect.texture=imgtext
imgrect.expand=true
imgrect.rect_size=Vector2(36,36)
imgrect.rect_min_size=Vector2(36,36)
var label=Label.new()
label.add_font_override("font",fontinf)
label.text=str(dict[item])
$HBoxContainer.add_child(imgrect)
$HBoxContainer.add_child(label)
pass
func _on_Panel_pressed():
if type=="goodfood":
character.food=min(character.food+1,character.maxfood)
character.reduceitem("Meat",1)
elif type=="drink":
character.drink=min(character.drink+1,character.maxdrink)
character.reduceitem("Drink",1)
elif type=="rawfood":
character.food=min(character.food+0.2,character.maxfood)
character.reduceitem("RawFood",1)
elif type=="fireplace" and abs(character.position.x)<character.get_parent().tilesize.x/2 and abs(character.position.y)<character.get_parent().tilesize.y/2:
character.spawnfireplace()
elif type=="watercollector" and abs(character.position.x)<character.get_parent().tilesize.x/2 and abs(character.position.y)<character.get_parent().tilesize.y/2:
character.spawnwatercollector()
self.focus_mode=Control.FOCUS_NONE
pass # Replace with function body.
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Item.gd" type="Script" id=1]
[ext_resource path="res://RawMeat.png" type="Texture" id=2]
[ext_resource path="res://Medici Text.ttf" type="DynamicFontData" id=3]
[sub_resource type="DynamicFont" id=2]
size = 40
font_data = ExtResource( 3 )
[node name="Panel" type="Button"]
margin_right = 120.0
margin_bottom = 40.0
rect_min_size = Vector2( 120, 40 )
script = ExtResource( 1 )
[node name="Texture" type="TextureRect" parent="."]
margin_left = 2.04393
margin_top = 2.0
margin_right = 38.0439
margin_bottom = 38.0
texture = ExtResource( 2 )
expand = true
stretch_mode = 5
[node name="Label" type="Label" parent="."]
margin_left = 41.0
margin_top = 1.0
margin_right = 115.0
margin_bottom = 39.0
custom_fonts/font = SubResource( 2 )
text = "1"
[connection signal="pressed" from="." to="." method="_on_Panel_pressed"]
[gd_scene load_steps=3 format=2]
[ext_resource path="res://RawMeat.png" type="Texture" id=1]
[ext_resource path="res://font.tres" type="DynamicFont" id=2]
[node name="Panel" type="Control"]
margin_right = 120.0
margin_bottom = 40.0
rect_min_size = Vector2( 120, 40 )
[node name="Texture" type="TextureRect" parent="."]
margin_left = 2.0
margin_top = 2.0
margin_right = 38.0
margin_bottom = 38.0
rect_min_size = Vector2( 36, 36 )
texture = ExtResource( 1 )
expand = true
stretch_mode = 5
[node name="Label" type="Label" parent="."]
margin_left = 41.0
margin_top = 1.0
margin_right = 56.0
margin_bottom = 39.0
custom_fonts/font = ExtResource( 2 )
text = "1"
extends Node2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
export var amountLights=16
# Called when the node enters the scene tree for the first time.
func _ready():
for i in range(amountLights):
var angle=i*360/amountLights
var positionLight=Vector2(cos(angle)*100,sin(angle)*100)
var actlight=Light2D.new()
actlight.texture=$Light2D.texture
actlight.texture_scale=4
actlight.energy=0.5
actlight.shadow_enabled=true
actlight.shadow_filter=Light2D.SHADOW_FILTER_PCF7
actlight.shadow_filter_smooth=4
actlight.shadow_gradient_length=30
actlight.position=positionLight
self.add_child(actlight)
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Lightgen.gd" type="Script" id=1]
[ext_resource path="res://lighttext.png" type="Texture" id=2]
[node name="Lightgen" type="Node2D"]
script = ExtResource( 1 )
[node name="Light2D" type="Light2D" parent="."]
texture = ExtResource( 2 )
texture_scale = 4.0
energy = 0.3
shadow_gradient_length = 50.0
shadow_filter = 3
shadow_filter_smooth = 3.9
File added
Meat.png

182 KB

[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Meat.png-7cad38d0b431e3493cea067f94187aa0.stex"
[deps]
source_file="res://Meat.png"
dest_files=[ "res://.import/Meat.png-7cad38d0b431e3493cea067f94187aa0.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=true
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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
File added
extends Node2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var gras=preload("res://Gras.png")
var ground=preload("res://Schlamm.png")
# Called when the node enters the scene tree for the first time.
func _ready():
var noise = ImageTexture.new()
var img= Image.new()
img.create(2, 2, false, Image.FORMAT_RGB8)
img.lock()
img.set_pixel(0,0,Color(0,0,0))
img.set_pixel(0,1,Color(1,0,0))
img.set_pixel(1,0,Color(0,1,0))
img.set_pixel(1,1,Color(0,0,1))
#img.unlock()
img.resize(gras.get_width(),gras.get_height(),Image.INTERPOLATE_CUBIC)
noise.create_from_image(img)
$Sprite2.texture=noise
$Sprite.material.set_shader_param("ground",ground)
$Sprite.material.set_shader_param("gras",gras)
$Sprite.material.set_shader_param("noise",noise)
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
shader_type canvas_item;
uniform sampler2D ground:hint_black;
uniform sampler2D grass:hint_black;
uniform sampler2D noise:hint_black;
void fragment() {
vec4 groundcolor=texture(ground,UV);
vec4 grasscolor=texture(grass,UV);
float amount=texture(noise,UV*0.1).r;
COLOR = groundcolor*amount+grasscolor*(1.0-amount);
//COLOR=texture(noise,UV*vec2(1,1));
}
\ No newline at end of file
[gd_resource type="ShaderMaterial" load_steps=4 format=2]
[ext_resource path="res://Noisetextblending.shader" type="Shader" id=1]
[ext_resource path="res://Schlamm.png" type="Texture" id=2]
[ext_resource path="res://Gras.png" type="Texture" id=3]
[resource]
resource_local_to_scene = true
shader = ExtResource( 1 )
shader_param/ground = ExtResource( 3 )
shader_param/grass = ExtResource( 2 )
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Noisetextblending.gd" type="Script" id=1]
[ext_resource path="res://lighttext.png" type="Texture" id=2]
[ext_resource path="res://Noisetextblending.tres" type="Material" id=3]
[node name="Noisetextblending" type="Node2D"]
script = ExtResource( 1 )
[node name="Light2D" type="Light2D" parent="."]
position = Vector2( 548.192, 300.065 )
texture = ExtResource( 2 )
texture_scale = 2.46
[node name="Sprite" type="Sprite" parent="."]
material = ExtResource( 3 )
position = Vector2( 512.016, 277.455 )
texture = ExtResource( 2 )
[node name="Sprite2" type="Sprite" parent="."]
position = Vector2( 512.016, 277.455 )
File added
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/RawMeat.png-1ef26ead6b6a565eff0366bb71114ab8.stex"
[deps]
source_file="res://RawMeat.png"
dest_files=[ "res://.import/RawMeat.png-1ef26ead6b6a565eff0366bb71114ab8.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=true
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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Schlamm.png

1.49 MB

[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/Schlamm.png-95ac55eaffc936fc25f5c91e4f757d45.s3tc.stex"
path.etc2="res://.import/Schlamm.png-95ac55eaffc936fc25f5c91e4f757d45.etc2.stex"
[deps]
source_file="res://Schlamm.png"
dest_files=[ "res://.import/Schlamm.png-95ac55eaffc936fc25f5c91e4f757d45.s3tc.stex", "res://.import/Schlamm.png-95ac55eaffc936fc25f5c91e4f757d45.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Shovel.png-eba271d8ded03e4ffe36e7351942f814.stex"
[deps]
source_file="res://Shovel.png"
dest_files=[ "res://.import/Shovel.png-eba271d8ded03e4ffe36e7351942f814.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=true
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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
extends StaticBody2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
var treenum=randi()%4
if(treenum==3 and randf()<0.8):
treenum=randi()%3
$icon.region_rect=Rect2(200*treenum,0,200,400)
$icon.scale.y=0.1+randf()/5
$icon.scale.y=0.1+randf()/5
$icon.offset.y=-150*($icon.scale.y/0.2)
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Tree.gd" type="Script" id=1]
[ext_resource path="res://Baeume.png" type="Texture" id=2]
[sub_resource type="OccluderPolygon2D" id=2]
polygon = PoolVector2Array( -0.0682526, -22.5949, 16.4251, -3.84228, 0.609566, 4.06547, -18.8209, -3.39041 )
[sub_resource type="CircleShape2D" id=3]
[node name="Tree" type="StaticBody2D"]
script = ExtResource( 1 )
[node name="icon" type="Sprite" parent="."]
scale = Vector2( 0.2, 0.2 )
texture = ExtResource( 2 )
offset = Vector2( 0, -150 )
region_enabled = true
region_rect = Rect2( 0, 0, 200, 400 )
[node name="LightOccluder2D" type="LightOccluder2D" parent="."]
occluder = SubResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 3 )
extends Area2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var water=0
var maxwater=10
var player
var fulltex
var emptytex
# Called when the node enters the scene tree for the first time.
func _ready():
fulltex=ImageTexture.new()
var fullimg=Image.new()
fullimg.load("res://Watercollector_full.png")
fulltex.create_from_image(fullimg)
emptytex=ImageTexture.new()
var emptyimg=Image.new()
emptyimg.load("res://Watercollector.png")
emptytex.create_from_image(emptyimg)
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if(global.weather=="raining"):
water=min(water+delta*0.1,maxwater)
if(water>5 and $Sprite.texture!=fulltex):
$Sprite.texture=fulltex
if(overlaps_body(player)):
if(Input.is_action_pressed("ui_select")):
if(player.items.has("Drink")):
player.items["Drink"]+=water
else:
player.items["Drink"]=water
player.updateitems()
water==0
if($Sprite.texture!=emptytex):
$Sprite.texture=emptytex
player.updateitems()
pass