├── .gitignore ├── icon.png.flags ├── sounds ├── sfx │ ├── CREDITS │ └── jumpland.wav └── ambience │ ├── CREDITS │ └── Jewel-Thieves.ogg ├── icon.png ├── cubiventure.png ├── sprites ├── src │ ├── README │ ├── msgbox.png │ ├── tomato.png │ ├── white.png │ ├── window.png │ ├── skillbar.png │ ├── button_wide.png │ ├── health_bar.png │ ├── health_hud.png │ ├── skillbar_p.png │ ├── blood_screen.png │ ├── blood_screen.xcf │ ├── button_wide_h.png │ ├── button_wide_p.png │ ├── notification_hud.png │ ├── notification_hud.xcf │ └── gui.svg ├── white.tex ├── msgbox.tex ├── skillbar.tex ├── tomato.tex ├── window.tex ├── health_bar.tex ├── health_hud.tex ├── skillbar_p.tex ├── blood_screen.tex ├── button_wide.tex ├── button_wide_h.tex ├── button_wide_p.tex └── notification_hud.tex ├── fonts ├── opensans.fnt ├── opensans_32.fnt └── OpenSans-Regular.ttf ├── models ├── props │ ├── box │ │ ├── box.scn │ │ └── box.blend │ ├── base │ │ ├── base.scn │ │ └── base.blend │ ├── tree │ │ ├── tree.scn │ │ ├── tree1.scn │ │ ├── tree.blend │ │ ├── pine_tree.scn │ │ └── pine_tree.blend │ ├── grass │ │ ├── grass.blend │ │ ├── grass.msh │ │ └── grass.scn │ ├── stone │ │ ├── stone.blend │ │ ├── stone.scn │ │ ├── stone1.scn │ │ └── stone2.scn │ └── tomato │ │ ├── tomato.scn │ │ └── tomato.blend ├── character │ ├── cubi │ │ ├── cubi.scn │ │ └── cubi.blend │ └── zombie │ │ ├── zombie.scn │ │ └── zombie.blend └── platform │ ├── grass_platform.scn │ └── grass_platform.blend ├── scripts ├── box.gd ├── notification_hud.gd ├── projectile.gd ├── skill_list.gd ├── area_object.gd ├── touch_button.gd ├── menu_window.gd ├── skill_window.gd ├── screen_button.gd ├── tomato.gd ├── joystick.gd ├── camera.gd ├── timecycle.gd ├── perlin_noise.gd ├── zombie.gd ├── globals.gd ├── levels.gd ├── game.gd └── player.gd ├── README.md ├── engine.cfg ├── LICENSE ├── scenes ├── zombie.tscn ├── tomato.tscn ├── skill_list.tscn ├── scenery.tscn ├── player.tscn └── game.tscn └── export.cfg /.gitignore: -------------------------------------------------------------------------------- 1 | *.blend1 2 | *.dae 3 | -------------------------------------------------------------------------------- /icon.png.flags: -------------------------------------------------------------------------------- 1 | gen_mipmaps=false 2 | -------------------------------------------------------------------------------- /sounds/sfx/CREDITS: -------------------------------------------------------------------------------- 1 | jumpland.wav 2 | by MentalSanityOff -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/icon.png -------------------------------------------------------------------------------- /cubiventure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/cubiventure.png -------------------------------------------------------------------------------- /sprites/src/README: -------------------------------------------------------------------------------- 1 | blood_screen.xcf, blood_screen.png: 2 | Blood brushes by KeReN-R 3 | -------------------------------------------------------------------------------- /sounds/ambience/CREDITS: -------------------------------------------------------------------------------- 1 | “Jewel Thieves” 2 | 3 | by Eric Matyas 4 | 5 | www.soundimage.org -------------------------------------------------------------------------------- /sprites/white.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/white.tex -------------------------------------------------------------------------------- /fonts/opensans.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/fonts/opensans.fnt -------------------------------------------------------------------------------- /sprites/msgbox.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/msgbox.tex -------------------------------------------------------------------------------- /sprites/skillbar.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/skillbar.tex -------------------------------------------------------------------------------- /sprites/tomato.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/tomato.tex -------------------------------------------------------------------------------- /sprites/window.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/window.tex -------------------------------------------------------------------------------- /fonts/opensans_32.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/fonts/opensans_32.fnt -------------------------------------------------------------------------------- /sprites/health_bar.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/health_bar.tex -------------------------------------------------------------------------------- /sprites/health_hud.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/health_hud.tex -------------------------------------------------------------------------------- /sprites/skillbar_p.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/skillbar_p.tex -------------------------------------------------------------------------------- /sprites/src/msgbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/msgbox.png -------------------------------------------------------------------------------- /sprites/src/tomato.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/tomato.png -------------------------------------------------------------------------------- /sprites/src/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/white.png -------------------------------------------------------------------------------- /sprites/src/window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/window.png -------------------------------------------------------------------------------- /models/props/box/box.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/box/box.scn -------------------------------------------------------------------------------- /sounds/sfx/jumpland.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sounds/sfx/jumpland.wav -------------------------------------------------------------------------------- /sprites/blood_screen.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/blood_screen.tex -------------------------------------------------------------------------------- /sprites/button_wide.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/button_wide.tex -------------------------------------------------------------------------------- /sprites/button_wide_h.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/button_wide_h.tex -------------------------------------------------------------------------------- /sprites/button_wide_p.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/button_wide_p.tex -------------------------------------------------------------------------------- /sprites/src/skillbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/skillbar.png -------------------------------------------------------------------------------- /fonts/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/fonts/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /models/props/base/base.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/base/base.scn -------------------------------------------------------------------------------- /models/props/box/box.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/box/box.blend -------------------------------------------------------------------------------- /models/props/tree/tree.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/tree/tree.scn -------------------------------------------------------------------------------- /models/props/tree/tree1.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/tree/tree1.scn -------------------------------------------------------------------------------- /scripts/box.gd: -------------------------------------------------------------------------------- 1 | extends RigidBody 2 | 3 | func _ready(): 4 | pass 5 | 6 | func destroy(): 7 | queue_free(); -------------------------------------------------------------------------------- /sprites/src/button_wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/button_wide.png -------------------------------------------------------------------------------- /sprites/src/health_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/health_bar.png -------------------------------------------------------------------------------- /sprites/src/health_hud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/health_hud.png -------------------------------------------------------------------------------- /sprites/src/skillbar_p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/skillbar_p.png -------------------------------------------------------------------------------- /models/character/cubi/cubi.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/character/cubi/cubi.scn -------------------------------------------------------------------------------- /models/props/base/base.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/base/base.blend -------------------------------------------------------------------------------- /models/props/grass/grass.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/grass/grass.blend -------------------------------------------------------------------------------- /models/props/grass/grass.msh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/grass/grass.msh -------------------------------------------------------------------------------- /models/props/grass/grass.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/grass/grass.scn -------------------------------------------------------------------------------- /models/props/stone/stone.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/stone/stone.blend -------------------------------------------------------------------------------- /models/props/stone/stone.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/stone/stone.scn -------------------------------------------------------------------------------- /models/props/stone/stone1.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/stone/stone1.scn -------------------------------------------------------------------------------- /models/props/stone/stone2.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/stone/stone2.scn -------------------------------------------------------------------------------- /models/props/tomato/tomato.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/tomato/tomato.scn -------------------------------------------------------------------------------- /models/props/tree/tree.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/tree/tree.blend -------------------------------------------------------------------------------- /sprites/notification_hud.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/notification_hud.tex -------------------------------------------------------------------------------- /sprites/src/blood_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/blood_screen.png -------------------------------------------------------------------------------- /sprites/src/blood_screen.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/blood_screen.xcf -------------------------------------------------------------------------------- /sprites/src/button_wide_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/button_wide_h.png -------------------------------------------------------------------------------- /sprites/src/button_wide_p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/button_wide_p.png -------------------------------------------------------------------------------- /models/character/cubi/cubi.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/character/cubi/cubi.blend -------------------------------------------------------------------------------- /models/props/tomato/tomato.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/tomato/tomato.blend -------------------------------------------------------------------------------- /models/props/tree/pine_tree.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/tree/pine_tree.scn -------------------------------------------------------------------------------- /sprites/src/notification_hud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/notification_hud.png -------------------------------------------------------------------------------- /sprites/src/notification_hud.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sprites/src/notification_hud.xcf -------------------------------------------------------------------------------- /models/character/zombie/zombie.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/character/zombie/zombie.scn -------------------------------------------------------------------------------- /models/platform/grass_platform.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/platform/grass_platform.scn -------------------------------------------------------------------------------- /models/props/tree/pine_tree.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/props/tree/pine_tree.blend -------------------------------------------------------------------------------- /sounds/ambience/Jewel-Thieves.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/sounds/ambience/Jewel-Thieves.ogg -------------------------------------------------------------------------------- /models/character/zombie/zombie.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/character/zombie/zombie.blend -------------------------------------------------------------------------------- /models/platform/grass_platform.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khairul169/cubiventure/HEAD/models/platform/grass_platform.blend -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Preview image](https://raw.githubusercontent.com/khairul169/cubiventure/master/cubiventure.png) 2 | 3 | Simple open world adventure game made with Godot Engine. 4 | -------------------------------------------------------------------------------- /scripts/notification_hud.gd: -------------------------------------------------------------------------------- 1 | extends TextureFrame 2 | 3 | func _ready(): 4 | pass 5 | 6 | func popup_notification(txt): 7 | get_node("txt").set_text(txt); 8 | get_node("AnimationPlayer").play("fade"); 9 | -------------------------------------------------------------------------------- /scripts/projectile.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var gravity = -9.8; 4 | var velocity = Vector2(); 5 | var startpoint = Vector2(); 6 | 7 | func getX(t): 8 | return velocity.x * t + startpoint.x; 9 | 10 | func getY(t): 11 | return 0.5 * gravity * t * t + velocity.y * t + startpoint.y; -------------------------------------------------------------------------------- /scripts/skill_list.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | var name = ""; 4 | var val = 0.0; 5 | var global_var = ""; 6 | 7 | func _ready(): 8 | get_node("btnPlus").connect("pressed", self, "on_btnPlus_pressed"); 9 | 10 | func on_btnPlus_pressed(): 11 | globals.game.skill_upgrade(self, global_var); -------------------------------------------------------------------------------- /scripts/area_object.gd: -------------------------------------------------------------------------------- 1 | extends Area 2 | 3 | func _ready(): 4 | connect("body_enter", self, "on_body_enter"); 5 | connect("body_exit", self, "on_body_exit"); 6 | 7 | func on_body_enter(body): 8 | if body != null && body.has_method("on_obj_enter"): 9 | body.call("on_obj_enter", self); 10 | 11 | func on_body_exit(body): 12 | if body != null && body.has_method("on_obj_exit"): 13 | body.call("on_obj_exit", self); -------------------------------------------------------------------------------- /engine.cfg: -------------------------------------------------------------------------------- 1 | [application] 2 | 3 | name="Cubiventure" 4 | main_scene="res://scenes/game.tscn" 5 | use_shared_user_dir=false 6 | target_fps=30 7 | icon="res://icon.png" 8 | 9 | [autoload] 10 | 11 | globals="*res://scripts/globals.gd" 12 | 13 | [display] 14 | 15 | borderless_window=false 16 | use_vsync=true 17 | 18 | [physics] 19 | 20 | fixed_fps=60 21 | 22 | [rasterizer] 23 | 24 | max_shadow_buffer_size=2048 25 | shadow_filter=0 26 | 27 | [rasterizer.Android] 28 | 29 | use_fragment_lighting=true 30 | -------------------------------------------------------------------------------- /scripts/touch_button.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | signal pressed(); 4 | 5 | var is_pressed = false; 6 | var touch_id = -1; 7 | 8 | func _ready(): 9 | if !OS.has_touchscreen_ui_hint(): 10 | hide(); 11 | return; 12 | 13 | touch_id = -1; 14 | set_process_input(true); 15 | 16 | func _input(ie): 17 | if !is_visible(): 18 | return; 19 | 20 | if ie.type == InputEvent.SCREEN_TOUCH: 21 | if ie.pressed && touch_id == -1: 22 | if get_global_rect().has_point(ie.pos): 23 | emit_signal("pressed"); 24 | is_pressed = true; 25 | touch_id = ie.index; 26 | elif !ie.pressed && ie.index == touch_id: 27 | is_pressed = false; 28 | touch_id = -1; 29 | -------------------------------------------------------------------------------- /scripts/menu_window.gd: -------------------------------------------------------------------------------- 1 | extends Patch9Frame 2 | 3 | func _ready(): 4 | get_node("btnReturn").connect("pressed", self, "on_btnReturn_pressed"); 5 | get_node("btnSettings").connect("pressed", self, "on_btnSettings_pressed"); 6 | get_node("btnSkill").connect("pressed", self, "on_btnSkill_pressed"); 7 | get_node("btnQuit").connect("pressed", self, "on_btnQuit_pressed"); 8 | 9 | func on_btnReturn_pressed(): 10 | globals.game.toggle_menu(false); 11 | 12 | func on_btnSettings_pressed(): 13 | globals.game.toggle_menu(false); 14 | 15 | func on_btnSkill_pressed(): 16 | globals.game.toggle_menu(false); 17 | globals.game.toggle_skillmenu(true); 18 | 19 | func on_btnQuit_pressed(): 20 | globals.quit_game(); 21 | globals.game.toggle_menu(false); -------------------------------------------------------------------------------- /scripts/skill_window.gd: -------------------------------------------------------------------------------- 1 | extends Patch9Frame 2 | 3 | var touch_idx = -1; 4 | 5 | func _ready(): 6 | set_process(true); 7 | set_process_input(true); 8 | 9 | func _process(delta): 10 | if !is_visible(): 11 | return; 12 | 13 | get_node("sp").set_text("SP: "+str(int(globals.skill_point))); 14 | 15 | func _input(ie): 16 | if !is_visible(): 17 | return; 18 | 19 | if ie.type == InputEvent.SCREEN_TOUCH: 20 | if ie.pressed && get_node("container").get_global_rect().has_point(ie.pos): 21 | touch_idx = ie.index; 22 | elif !ie.pressed && ie.index == touch_idx: 23 | touch_idx = -1; 24 | 25 | if ie.type == InputEvent.SCREEN_DRAG && ie.index == touch_idx: 26 | get_node("container").set_v_scroll(get_node("container").get_v_scroll()-ie.relative_y); -------------------------------------------------------------------------------- /scripts/screen_button.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | var touch_id; 4 | var pressed; 5 | 6 | func _ready(): 7 | if !OS.has_touchscreen_ui_hint(): 8 | hide(); 9 | return; 10 | 11 | touch_id = -1; 12 | pressed = false; 13 | set_process_input(true); 14 | 15 | func _input(ie): 16 | if ie.type == InputEvent.SCREEN_TOUCH: 17 | if ie.pressed && touch_id == -1: 18 | touch_id = ie.index; 19 | 20 | if get_global_rect().has_point(ie.pos): 21 | pressed = true; 22 | else: 23 | pressed = false; 24 | elif !ie.pressed && ie.index == touch_id: 25 | touch_id = -1; 26 | pressed = false; 27 | 28 | if ie.type == InputEvent.SCREEN_DRAG: 29 | if ie.index == touch_id: 30 | if get_global_rect().has_point(ie.pos): 31 | pressed = true; 32 | else: 33 | pressed = false; -------------------------------------------------------------------------------- /scripts/tomato.gd: -------------------------------------------------------------------------------- 1 | extends RigidBody 2 | 3 | const ALIVE_TIMEOUT = 5.0; 4 | 5 | var time = 0.0; 6 | var owner = null; 7 | 8 | func _ready(): 9 | connect("body_enter", self, "body_enter"); 10 | set_process(true); 11 | 12 | func _process(delta): 13 | time += delta; 14 | 15 | if time >= ALIVE_TIMEOUT: 16 | queue_free(); 17 | 18 | func body_enter(body): 19 | if owner == null: 20 | return; 21 | 22 | if owner extends preload("res://scripts/zombie.gd") && body extends preload("res://scripts/player.gd"): 23 | globals.game.player_apply_damage(rand_range(5.0,10.0)); 24 | queue_free(); 25 | 26 | if owner extends preload("res://scripts/player.gd") && body extends preload("res://scripts/zombie.gd"): 27 | body.kill(); 28 | globals.game.player_give_exp(40); 29 | globals.game.player_apply_damage(-20); 30 | queue_free(); 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Khairul 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /scenes/zombie.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=1] 2 | 3 | [ext_resource path="res://scripts/zombie.gd" type="Script" id=1] 4 | [ext_resource path="res://models/character/zombie/zombie.scn" type="PackedScene" id=2] 5 | 6 | [sub_resource type="CapsuleShape" id=1] 7 | 8 | radius = 0.6 9 | height = 0.6 10 | 11 | [node name="zombie" type="KinematicBody"] 12 | 13 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 14 | input/ray_pickable = true 15 | input/capture_on_drag = false 16 | shape_count = 1 17 | shapes/0/shape = SubResource( 1 ) 18 | shapes/0/transform = Transform( 1.91069e-15, -1, -4.37114e-08, -4.37114e-08, -4.37114e-08, 1, -1, 0, -4.37114e-08, 0, 0.900936, 0 ) 19 | shapes/0/trigger = false 20 | collision/layers = 1 21 | collision/mask = 1 22 | collide_with/static = true 23 | collide_with/kinematic = true 24 | collide_with/rigid = true 25 | collide_with/character = true 26 | collision/margin = 0.001 27 | script/script = ExtResource( 1 ) 28 | 29 | [node name="col" type="CollisionShape" parent="."] 30 | 31 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 32 | transform/local = Transform( 1.91069e-15, -1, -4.37114e-08, -4.37114e-08, -4.37114e-08, 1, -1, 0, -4.37114e-08, 0, 0.900936, 0 ) 33 | shape = SubResource( 1 ) 34 | trigger = false 35 | _update_shape_index = 0 36 | 37 | [node name="models" parent="." instance=ExtResource( 2 )] 38 | 39 | 40 | -------------------------------------------------------------------------------- /scenes/tomato.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=1] 2 | 3 | [ext_resource path="res://scripts/tomato.gd" type="Script" id=1] 4 | [ext_resource path="res://models/props/tomato/tomato.scn" type="PackedScene" id=2] 5 | 6 | [sub_resource type="SphereShape" id=1] 7 | 8 | radius = 0.240438 9 | 10 | [node name="tomato" type="RigidBody"] 11 | 12 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 13 | input/ray_pickable = true 14 | input/capture_on_drag = false 15 | shape_count = 1 16 | shapes/0/shape = SubResource( 1 ) 17 | shapes/0/transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 18 | shapes/0/trigger = false 19 | collision/layers = 1 20 | collision/mask = 1 21 | mode = 0 22 | mass = 1.0 23 | friction = 1.0 24 | bounce = 0.0 25 | gravity_scale = 1.0 26 | custom_integrator = false 27 | continuous_cd = false 28 | contacts_reported = 3 29 | contact_monitor = true 30 | sleeping = false 31 | can_sleep = true 32 | axis_lock = 0 33 | velocity/linear = Vector3( 0, 0, 0 ) 34 | velocity/angular = Vector3( 0, 0, 0 ) 35 | damp_override/linear = -1.0 36 | damp_override/angular = -1.0 37 | script/script = ExtResource( 1 ) 38 | 39 | [node name="tomato" parent="." instance=ExtResource( 2 )] 40 | 41 | [node name="CollisionShape" type="CollisionShape" parent="."] 42 | 43 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 44 | shape = SubResource( 1 ) 45 | trigger = false 46 | _update_shape_index = 0 47 | 48 | 49 | -------------------------------------------------------------------------------- /scripts/joystick.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | var active = false; 4 | var joystick; 5 | var touch_id; 6 | 7 | var margin = Vector2(-32,-32); 8 | var direction = Vector2(0, 0); 9 | 10 | func reset(): 11 | touch_id = -1 12 | active = false 13 | direction = Vector2(0, 0) 14 | joystick.set_pos(margin) 15 | 16 | func is_inside(pos): 17 | var t = joystick.get_global_transform() 18 | t = t.inverse() 19 | var p = t.xform(pos) 20 | var r = joystick.get_item_rect() 21 | 22 | return r.has_point(p) 23 | 24 | func move_joystick(pos): 25 | if get_tree().is_paused(): 26 | return; 27 | 28 | var t = self.get_global_transform() 29 | t = t.inverse() 30 | var p = t.xform(pos) 31 | 32 | var r = get_node("bg").get_item_rect() 33 | var max_len = min(r.size.width/2, r.size.height/2) 34 | 35 | var len = clamp(p.length(), 0, max_len) 36 | 37 | direction = p.normalized() 38 | 39 | p = direction * len; 40 | p += margin; 41 | joystick.set_pos(p) 42 | 43 | func _input(e): 44 | if !is_visible(): 45 | return; 46 | 47 | if OS.has_touchscreen_ui_hint(): 48 | if e.type == InputEvent.SCREEN_TOUCH: 49 | if e.pressed: 50 | if is_inside(e.pos): 51 | active = true; 52 | touch_id = e.index; 53 | elif e.index == touch_id: 54 | reset(); 55 | 56 | elif e.type == InputEvent.SCREEN_DRAG: 57 | if active && e.index == touch_id: 58 | move_joystick(e.pos); 59 | else: 60 | if e.type == InputEvent.MOUSE_BUTTON: 61 | if e.pressed: 62 | if is_inside(e.pos): 63 | active = true; 64 | else: 65 | reset(); 66 | 67 | elif e.type == InputEvent.MOUSE_MOTION && active: 68 | move_joystick(e.pos) 69 | 70 | func _ready(): 71 | #if !OS.has_touchscreen_ui_hint(): 72 | #hide(); 73 | #return; 74 | 75 | joystick = get_node("joy"); 76 | set_process_input(true); 77 | -------------------------------------------------------------------------------- /scenes/skill_list.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=1] 2 | 3 | [ext_resource path="res://scripts/skill_list.gd" type="Script" id=1] 4 | [ext_resource path="res://sprites/skillbar.tex" type="Texture" id=2] 5 | [ext_resource path="res://sprites/skillbar_p.tex" type="Texture" id=3] 6 | [ext_resource path="res://fonts/opensans.fnt" type="BitmapFont" id=4] 7 | 8 | [node name="skill" type="Control"] 9 | 10 | rect/min_size = Vector2( 380, 48 ) 11 | focus/ignore_mouse = false 12 | focus/stop_mouse = true 13 | size_flags/horizontal = 2 14 | size_flags/vertical = 2 15 | margin/left = 0.0 16 | margin/top = 0.0 17 | margin/right = 380.0 18 | margin/bottom = 48.0 19 | script/script = ExtResource( 1 ) 20 | 21 | [node name="progress" type="TextureProgress" parent="."] 22 | 23 | focus/ignore_mouse = false 24 | focus/stop_mouse = true 25 | size_flags/horizontal = 2 26 | size_flags/vertical = 2 27 | margin/left = 0.0 28 | margin/top = 20.0 29 | margin/right = 306.0 30 | margin/bottom = 47.0 31 | range/min = 0.0 32 | range/max = 100.0 33 | range/step = 1.0 34 | range/page = 0.0 35 | range/value = 10.0 36 | range/exp_edit = false 37 | range/rounded = false 38 | texture/under = ExtResource( 2 ) 39 | texture/over = null 40 | texture/progress = ExtResource( 3 ) 41 | radial_fill/fill_degrees = 360.0 42 | radial_fill/center_offset = Vector2( 0, 0 ) 43 | 44 | [node name="lbl" type="Label" parent="."] 45 | 46 | focus/ignore_mouse = true 47 | focus/stop_mouse = true 48 | size_flags/horizontal = 2 49 | margin/left = 0.0 50 | margin/top = 0.0 51 | margin/right = 93.0 52 | margin/bottom = 20.0 53 | custom_fonts/font = ExtResource( 4 ) 54 | custom_colors/font_color = Color( 0.772549, 0.772549, 0.772549, 1 ) 55 | text = "Sprint (1/10)" 56 | percent_visible = 1.0 57 | lines_skipped = 0 58 | max_lines_visible = -1 59 | 60 | [node name="btnPlus" type="Button" parent="."] 61 | 62 | focus/ignore_mouse = false 63 | focus/stop_mouse = true 64 | size_flags/horizontal = 2 65 | size_flags/vertical = 2 66 | margin/left = 315.0 67 | margin/top = 20.0 68 | margin/right = 375.0 69 | margin/bottom = 45.0 70 | toggle_mode = false 71 | enabled_focus_mode = 2 72 | shortcut = null 73 | text = "+1" 74 | flat = false 75 | 76 | 77 | -------------------------------------------------------------------------------- /scripts/camera.gd: -------------------------------------------------------------------------------- 1 | extends Camera 2 | 3 | var player = null; 4 | var pitch = 20.0; 5 | var yaw = 0.0; 6 | var cpitch = pitch; 7 | var cyaw = yaw; 8 | var dist = 8.0; 9 | var cdist = dist; 10 | var active = false; 11 | var sensitivity = 0.5; 12 | var ray_res = {}; 13 | var excl = []; 14 | var pos = Vector3(); 15 | var target = Vector3(); 16 | 17 | func _ready(): 18 | player = get_node("../"); 19 | 20 | set_process(true); 21 | set_process_input(true); 22 | set_fixed_process(true); 23 | 24 | func set_active(t = true): 25 | if t: 26 | active = true; 27 | Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED); 28 | else: 29 | active = false; 30 | Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE); 31 | 32 | func _input(ie): 33 | if !active: 34 | return; 35 | 36 | if ie.type == InputEvent.MOUSE_MOTION: 37 | pitch = clamp(pitch+ie.relative_y*sensitivity, -80.0, 80.0); 38 | yaw = fmod(yaw-ie.relative_x*sensitivity, 360.0); 39 | 40 | if !globals.cfg_caminterpolation: 41 | update_camera(); 42 | 43 | func _process(delta): 44 | if globals.cfg_caminterpolation: 45 | cpitch = lerp(cpitch, pitch, 10*delta); 46 | cyaw += (abs(cyaw-yaw)>180)*sign(cyaw)*-360.0; 47 | cyaw = lerp(cyaw, yaw, 10*delta); 48 | else: 49 | cpitch = pitch; 50 | cyaw = yaw; 51 | 52 | if player.aiming: 53 | cdist = lerp(cdist, 4.0, 10*delta); 54 | else: 55 | cdist = lerp(cdist, dist, 10*delta); 56 | 57 | update_camera(); 58 | 59 | func update_camera(): 60 | pos = player.get_global_transform().origin; 61 | pos.x += cdist*sin(deg2rad(cyaw))*cos(deg2rad(cpitch)); 62 | pos.y += cdist*sin(deg2rad(cpitch)); 63 | pos.z += cdist*cos(deg2rad(cyaw))*cos(deg2rad(cpitch)); 64 | target = player.get_global_transform().origin+Vector3(0,1.5,0); 65 | 66 | if player.aiming: 67 | var m = Vector3(2.0*cos(deg2rad(cyaw)),0,2.0*-sin(deg2rad(cyaw))); 68 | pos += m; 69 | target += m; 70 | 71 | var from = pos; 72 | if !ray_res.empty() && ray_res.collider extends StaticBody: 73 | from = ray_res.position; 74 | 75 | look_at_from_pos(from, target, Vector3(0,1,0)); 76 | 77 | func _fixed_process(delta): 78 | ray_res = get_world().get_direct_space_state().intersect_ray(target, pos, excl); 79 | -------------------------------------------------------------------------------- /scripts/timecycle.gd: -------------------------------------------------------------------------------- 1 | extends Spatial 2 | 3 | const SPEED = 5.0; 4 | const SUN_ANGLE = 45.0; 5 | 6 | const lightningMin = 0.3; 7 | const lightningMax = 0.8; 8 | 9 | var delay; 10 | var env; 11 | var dirlight; 12 | 13 | func _ready(): 14 | delay = 0.0; 15 | env = get_node("WorldEnvironment").get_environment(); 16 | dirlight = get_node("DirectionalLight"); 17 | 18 | env.set_enable_fx(Environment.FX_FXAA, globals.cfg_fxaa); 19 | env.set_enable_fx(Environment.FX_GLOW, globals.cfg_glow); 20 | env.set_enable_fx(Environment.FX_FOG, globals.cfg_fog); 21 | dirlight.set_project_shadows(globals.cfg_shadow); 22 | set_process(true); 23 | 24 | func calculate_lightning(hour, minute): 25 | var ctime = (hour + (minute / 60.0)) / 24.0; 26 | var light = lightningMax * sin(PI*ctime); 27 | return clamp(light, lightningMin, lightningMax); 28 | 29 | func _process(delta): 30 | globals.world_time += 1/60.0*SPEED*delta; 31 | if globals.world_time >= 24.0: 32 | globals.world_time -= 24.0; 33 | 34 | delay -= delta; 35 | if delay > 0.0: 36 | return; 37 | delay = 1.0/globals.cfg_timecyclefps; 38 | 39 | var sunmoon_angle = deg2rad(360*(globals.world_time/24.0)); 40 | get_node("pivot").set_rotation(Vector3(0, deg2rad(SUN_ANGLE), sunmoon_angle)); 41 | 42 | var light = calculate_lightning(floor(globals.world_time), (globals.world_time-floor(globals.world_time))*60); 43 | dirlight.set_parameter(Light.PARAM_ENERGY, light); 44 | var target_light = get_node("pivot/sun").get_global_transform().origin; 45 | if globals.world_time < 5.5 || globals.world_time >= 18.0: 46 | target_light = get_node("pivot/moon").get_global_transform().origin; 47 | dirlight.look_at_from_pos(target_light, get_global_transform().origin, Vector3(0,1,0)); 48 | 49 | var light_color = Color(1,1,1); 50 | if globals.world_time >= 17.5 && globals.world_time < 18: 51 | var d = (globals.world_time-17.5)/0.5; 52 | light_color = Color(1-((1-17/255.0)*d), 1-((1-27/255.0)*d), 1-((1-65/255.0)*d)); 53 | light = lightningMin+((calculate_lightning(18.0, 0.0)-lightningMin)*(1.0-d)); 54 | elif globals.world_time >= 5.5 && globals.world_time < 6.0: 55 | var d = (globals.world_time-5.5)/0.5; 56 | light_color = Color((17/255.0)+((1-17/255.0)*d), (27/255.0)+((1-27/255.0)*d), (65/255.0)+((1-65/255.0)*d)); 57 | light = lightningMin+((calculate_lightning(6.0, 0.0)-lightningMin)*d); 58 | elif globals.world_time >= 18 || globals.world_time < 5.5: 59 | light = lightningMin; 60 | light_color = Color8(17, 27, 65); 61 | 62 | dirlight.set_color(Light.COLOR_DIFFUSE, light_color); 63 | 64 | var bg = Color(169/255.0*(light-0.1), 189/255.0*(light-0.1), 242/255.0*(light-0.1)); 65 | var col = Color(light,light,light); 66 | env.set_background_param(Environment.BG_PARAM_COLOR, bg); 67 | env.fx_set_param(Environment.FX_PARAM_AMBIENT_LIGHT_COLOR, col); 68 | env.fx_set_param(Environment.FX_PARAM_AMBIENT_LIGHT_ENERGY, 0.2+(0.4*light)); -------------------------------------------------------------------------------- /scripts/perlin_noise.gd: -------------------------------------------------------------------------------- 1 | # Perlin.cpp 2 | # 3 | # Copyright Chris Little 2012 4 | # Author: Chris Little 5 | 6 | extends Node 7 | 8 | var p = []; 9 | var Gx = []; 10 | var Gy = [] 11 | var Gz = [] 12 | 13 | func _init(): 14 | p.resize(256); 15 | Gx.resize(256); 16 | Gy.resize(256); 17 | Gz.resize(256); 18 | 19 | set_seed(OS.get_unix_time()); 20 | 21 | func generate_rand(): 22 | for i in range(256): 23 | p[i] = i; 24 | 25 | Gx[i] = randf() - 1.0; 26 | Gy[i] = randf() - 1.0; 27 | Gz[i] = randf() - 1.0; 28 | 29 | var j=0; 30 | var swp=0; 31 | for i in range(256): 32 | j = randi() & 255; 33 | 34 | swp = p[i]; 35 | p[i] = p[j]; 36 | p[j] = swp; 37 | 38 | func set_seed(seeds): 39 | seed(seeds); 40 | generate_rand(); 41 | 42 | func noise(sample_x, sample_y, sample_z): 43 | # Unit cube vertex coordinates surrounding the sample povar 44 | var x0 = int(floor(sample_x)); 45 | var x1 = x0 + 1; 46 | var y0 = int(floor(sample_y)); 47 | var y1 = y0 + 1; 48 | var z0 = int(floor(sample_z)); 49 | var z1 = z0 + 1; 50 | 51 | # Determine sample povar position within unit cube 52 | var px0 = sample_x - float(x0); 53 | var px1 = px0 - 1.0; 54 | var py0 = sample_y - float(y0); 55 | var py1 = py0 - 1.0; 56 | var pz0 = sample_z - float(z0); 57 | var pz1 = pz0 - 1.0; 58 | 59 | # Compute dot product between gradient and sample position vector 60 | var gIndex = p[(x0 + p[(y0 + p[z0 & 255]) & 255]) & 255]; 61 | var d000 = Gx[gIndex]*px0 + Gy[gIndex]*py0 + Gz[gIndex]*pz0; 62 | gIndex = p[(x1 + p[(y0 + p[z0 & 255]) & 255]) & 255]; 63 | var d001 = Gx[gIndex]*px1 + Gy[gIndex]*py0 + Gz[gIndex]*pz0; 64 | 65 | gIndex = p[(x0 + p[(y1 + p[z0 & 255]) & 255]) & 255]; 66 | var d010 = Gx[gIndex]*px0 + Gy[gIndex]*py1 + Gz[gIndex]*pz0; 67 | gIndex = p[(x1 + p[(y1 + p[z0 & 255]) & 255]) & 255]; 68 | var d011 = Gx[gIndex]*px1 + Gy[gIndex]*py1 + Gz[gIndex]*pz0; 69 | 70 | gIndex = p[(x0 + p[(y0 + p[z1 & 255]) & 255]) & 255]; 71 | var d100 = Gx[gIndex]*px0 + Gy[gIndex]*py0 + Gz[gIndex]*pz1; 72 | gIndex = p[(x1 + p[(y0 + p[z1 & 255]) & 255]) & 255]; 73 | var d101 = Gx[gIndex]*px1 + Gy[gIndex]*py0 + Gz[gIndex]*pz1; 74 | 75 | gIndex = p[(x0 + p[(y1 + p[z1 & 255]) & 255]) & 255]; 76 | var d110 = Gx[gIndex]*px0 + Gy[gIndex]*py1 + Gz[gIndex]*pz1; 77 | gIndex = p[(x1 + p[(y1 + p[z1 & 255]) & 255]) & 255]; 78 | var d111 = Gx[gIndex]*px1 + Gy[gIndex]*py1 + Gz[gIndex]*pz1; 79 | 80 | # varerpolate dot product values at sample povar using polynomial varerpolation 6x^5 - 15x^4 + 10x^3 81 | var wx = ((6*px0 - 15)*px0 + 10)*px0*px0*px0; 82 | var wy = ((6*py0 - 15)*py0 + 10)*py0*py0*py0; 83 | var wz = ((6*pz0 - 15)*pz0 + 10)*pz0*pz0*pz0; 84 | 85 | var xa = d000 + wx*(d001 - d000); 86 | var xb = d010 + wx*(d011 - d010); 87 | var xc = d100 + wx*(d101 - d100); 88 | var xd = d110 + wx*(d111 - d110); 89 | var ya = xa + wy*(xb - xa); 90 | var yb = xc + wy*(xd - xc); 91 | var value = ya + wz*(yb - ya); 92 | 93 | return value; 94 | -------------------------------------------------------------------------------- /scripts/zombie.gd: -------------------------------------------------------------------------------- 1 | extends KinematicBody 2 | 3 | # Member variables 4 | var g = -19.6; 5 | var vel = Vector3(); 6 | var dir = Vector3(); 7 | var chunk = [0,0]; 8 | 9 | # Constants 10 | const MAX_SLOPE_ANGLE = 30; 11 | const ATTACK_DELAY = 1.0; 12 | 13 | var on_floor = false; 14 | var next_idle = 0.0; 15 | var next_attack = 0.0; 16 | 17 | var tomato = "res://scenes/tomato.tscn"; 18 | 19 | func _ready(): 20 | tomato = load(tomato); 21 | 22 | set_fixed_process(true); 23 | 24 | func _fixed_process(delta): 25 | vel.y += g*delta 26 | 27 | var motion = move(vel*delta) 28 | 29 | on_floor = false 30 | var original_vel = vel 31 | var floor_velocity = Vector3() 32 | var attempts = 4 33 | 34 | while(is_colliding() and attempts): 35 | var n = get_collision_normal(); 36 | var p = get_collision_pos(); 37 | var collider = get_collider(); 38 | 39 | if (rad2deg(acos(n.dot(Vector3(0, 1, 0)))) < MAX_SLOPE_ANGLE): 40 | # If angle to the "up" vectors is < angle tolerance, 41 | # char is on floor 42 | floor_velocity = get_collider_velocity() 43 | on_floor = true 44 | 45 | motion = n.slide(motion) 46 | vel = n.slide(vel) 47 | if (original_vel.dot(vel) > 0): 48 | # Do not allow to slide towads the opposite direction we were coming from 49 | motion=move(motion) 50 | if (motion.length() < 0.001): 51 | break 52 | attempts -= 1 53 | 54 | if (on_floor and floor_velocity != Vector3()): 55 | move(floor_velocity*delta) 56 | 57 | var trans = get_transform(); 58 | trans.basis = Matrix3(Quat(trans.basis).slerp(Quat(Vector3(0,1,0), -atan2(dir.x, dir.z)), 10*delta)); 59 | set_transform(trans); 60 | 61 | if globals.game.time > next_idle: 62 | next_idle = globals.game.time + 2.0; 63 | set_animation("idle"); 64 | 65 | if globals.player != null && !globals.player_dying: 66 | var dist = globals.player.get_global_transform().origin-get_global_transform().origin; 67 | var eyesight = 15.0; 68 | if globals.world_time >= 18 || globals.world_time < 5.5: 69 | eyesight = 20.0; 70 | 71 | if dist.length() < eyesight: 72 | dir.x = dist.x; 73 | dir.z = dist.z; 74 | dir = dir.normalized(); 75 | attack(); 76 | 77 | func set_animation(ani, force = false, speed = 1.0): 78 | var ap = get_node("models/animations"); 79 | if ap.get_current_animation() != ani || force: 80 | ap.play(ani); 81 | ap.set_speed(speed); 82 | 83 | func attack(): 84 | if globals.game.time < next_attack: 85 | return; 86 | 87 | next_idle = globals.game.time+ATTACK_DELAY; 88 | next_attack = next_idle; 89 | 90 | set_animation("shoot", true); 91 | 92 | var inst = tomato.instance(); 93 | inst.owner = self; 94 | inst.set_translation(get_translation()+dir+Vector3(0,1.5,0)); 95 | inst.apply_impulse(Vector3(), dir*20); 96 | inst.set_angular_velocity(Vector3(1,1,1)*deg2rad(360)); 97 | get_node("../").add_child(inst, true); 98 | 99 | func kill(): 100 | var arr = globals.zombies_killed; 101 | arr.push_back(chunk); 102 | globals.zombies_killed = arr; 103 | queue_free(); 104 | -------------------------------------------------------------------------------- /scenes/scenery.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=1] 2 | 3 | [ext_resource path="res://scripts/timecycle.gd" type="Script" id=1] 4 | 5 | [sub_resource type="Environment" id=1] 6 | 7 | ambient_light/enabled = true 8 | ambient_light/color = Color( 0.0988508, 0.0939484, 0.183594, 1 ) 9 | ambient_light/energy = 0.2 10 | fxaa/enabled = true 11 | background/mode = 2 12 | background/color = Color( 0.663712, 0.74313, 0.949219, 1 ) 13 | background/texture = null 14 | background/cubemap = null 15 | background/energy = 1.0 16 | background/scale = 1.0 17 | background/glow = 0.1 18 | background/canvas_max_layer = null 19 | glow/enabled = true 20 | glow/blur_passes = 1 21 | glow/blur_scale = 1 22 | glow/blur_strength = 1 23 | glow/blur_blend_mode = null 24 | glow/bloom = 0.2 25 | glow/bloom_treshold = 0.5 26 | dof_blur/enabled = false 27 | dof_blur/blur_passes = 1 28 | dof_blur/begin = 100.0 29 | dof_blur/range = 10.0 30 | hdr/enabled = false 31 | hdr/tonemapper = 0 32 | hdr/exposure = 0.4 33 | hdr/white = 1.0 34 | hdr/glow_treshold = 0.95 35 | hdr/glow_scale = 0.2 36 | hdr/min_luminance = 0.4 37 | hdr/max_luminance = 8.0 38 | hdr/exposure_adj_speed = 0.5 39 | fog/enabled = true 40 | fog/begin = 0.01 41 | fog/begin_color = Color( 0.191406, 0.191406, 0.191406, 1 ) 42 | fog/end_color = Color( 0.386719, 0.386719, 0.386719, 1 ) 43 | fog/attenuation = 1.31951 44 | fog/bg = true 45 | bcs/enabled = false 46 | bcs/brightness = 1.0 47 | bcs/contrast = 1.0 48 | bcs/saturation = 1.0 49 | srgb/enabled = false 50 | 51 | [node name="scenery" type="Spatial"] 52 | 53 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 54 | script/script = ExtResource( 1 ) 55 | 56 | [node name="pivot" type="Spatial" parent="."] 57 | 58 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 59 | transform/local = Transform( -0.422977, 0.906141, 0, -0.906141, -0.422977, 0, 0, 0, 1, 0, 0, 0 ) 60 | __meta__ = { "_editor_collapsed":true } 61 | 62 | [node name="moon" type="Spatial" parent="pivot"] 63 | 64 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 65 | transform/local = Transform( 100, 0, 0, 0, 100, 0, 0, 0, 100, 0, 1000, 0 ) 66 | 67 | [node name="sun" type="Spatial" parent="pivot"] 68 | 69 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 70 | transform/local = Transform( 100, 0, 0, 0, 100, 0, 0, 0, 100, -3.05176e-05, -1000, 0 ) 71 | 72 | [node name="DirectionalLight" type="DirectionalLight" parent="."] 73 | 74 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 75 | transform/local = Transform( -0.198268, -0.728729, 0.655472, 0, 0.668748, 0.743489, -0.980148, 0.14741, -0.132592, 0, 0, 0 ) 76 | layers = 1 77 | params/enabled = true 78 | params/editor_only = false 79 | params/bake_mode = 3 80 | params/energy = 1.0 81 | colors/diffuse = Color( 1, 1, 1, 1 ) 82 | colors/specular = Color( 1, 1, 1, 1 ) 83 | shadow/shadow = true 84 | shadow/darkening = 0.2 85 | shadow/z_offset = 0.5 86 | shadow/z_slope_scale = 0.0 87 | shadow/esm_multiplier = 100.0 88 | shadow/blur_passes = 1.0 89 | projector = null 90 | operator = 0 91 | shadow/mode = 2 92 | shadow/max_distance = 50.0 93 | shadow/split_weight = 0.5 94 | shadow/zoffset_scale = 2.0 95 | 96 | [node name="WorldEnvironment" type="WorldEnvironment" parent="."] 97 | 98 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 99 | environment = SubResource( 1 ) 100 | 101 | 102 | -------------------------------------------------------------------------------- /scenes/player.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=1] 2 | 3 | [ext_resource path="res://scripts/player.gd" type="Script" id=1] 4 | [ext_resource path="res://scripts/camera.gd" type="Script" id=2] 5 | [ext_resource path="res://models/character/cubi/cubi.scn" type="PackedScene" id=3] 6 | [ext_resource path="res://sounds/sfx/jumpland.wav" type="Sample" id=4] 7 | 8 | [sub_resource type="CapsuleShape" id=1] 9 | 10 | radius = 0.6 11 | height = 0.6 12 | 13 | [sub_resource type="SampleLibrary" id=2] 14 | 15 | samples/jumpland = { "db":0.0, "pitch":1.0, "sample":ExtResource( 4 ) } 16 | 17 | [sub_resource type="FixedMaterial" id=3] 18 | 19 | flags/visible = true 20 | flags/double_sided = false 21 | flags/invert_faces = false 22 | flags/unshaded = false 23 | flags/on_top = false 24 | flags/lightmap_on_uv2 = true 25 | flags/colarray_is_srgb = true 26 | params/blend_mode = 0 27 | params/depth_draw = 1 28 | params/line_width = 0.0 29 | fixed_flags/use_alpha = true 30 | fixed_flags/use_color_array = false 31 | fixed_flags/use_point_size = false 32 | fixed_flags/discard_alpha = false 33 | fixed_flags/use_xy_normalmap = false 34 | params/diffuse = Color( 1, 0, 0, 0.61809 ) 35 | params/specular = Color( 0, 0, 0, 1 ) 36 | params/emission = Color( 1, 0, 0, 1 ) 37 | params/specular_exp = 40 38 | params/detail_mix = 1.0 39 | params/normal_depth = 1 40 | params/shader = 0 41 | params/shader_param = 0.5 42 | params/glow = 0 43 | params/point_size = 1.0 44 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 45 | textures/diffuse = null 46 | textures/diffuse_tc = 0 47 | textures/detail = null 48 | textures/detail_tc = 0 49 | textures/specular = null 50 | textures/specular_tc = 0 51 | textures/emission = null 52 | textures/emission_tc = 0 53 | textures/specular_exp = null 54 | textures/specular_exp_tc = 0 55 | textures/glow = null 56 | textures/glow_tc = 0 57 | textures/normal = null 58 | textures/normal_tc = 0 59 | textures/shade_param = null 60 | textures/shade_param_tc = 0 61 | 62 | [node name="player" type="KinematicBody"] 63 | 64 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 65 | input/ray_pickable = true 66 | input/capture_on_drag = false 67 | shape_count = 1 68 | shapes/0/shape = SubResource( 1 ) 69 | shapes/0/transform = Transform( 1.91069e-15, -1, -4.37114e-08, -4.37114e-08, -4.37114e-08, 1, -1, 0, -4.37114e-08, 0, 0.900936, 0 ) 70 | shapes/0/trigger = false 71 | collision/layers = 1 72 | collision/mask = 1 73 | collide_with/static = true 74 | collide_with/kinematic = true 75 | collide_with/rigid = true 76 | collide_with/character = true 77 | collision/margin = 0.001 78 | script/script = ExtResource( 1 ) 79 | 80 | [node name="cam" type="Camera" parent="."] 81 | 82 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 83 | projection = 0 84 | fov = 60.0 85 | near = 0.1 86 | far = 100.0 87 | keep_aspect = 1 88 | current = false 89 | visible_layers = 1048575 90 | environment = null 91 | h_offset = 0.0 92 | v_offset = 0.0 93 | script/script = ExtResource( 2 ) 94 | 95 | [node name="col" type="CollisionShape" parent="."] 96 | 97 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 98 | transform/local = Transform( 1.91069e-15, -1, -4.37114e-08, -4.37114e-08, -4.37114e-08, 1, -1, 0, -4.37114e-08, 0, 0.900936, 0 ) 99 | shape = SubResource( 1 ) 100 | trigger = false 101 | _update_shape_index = 0 102 | 103 | [node name="models" parent="." instance=ExtResource( 3 )] 104 | 105 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -5.73206e-16, 0 ) 106 | 107 | [node name="sfx" type="SpatialSamplePlayer" parent="."] 108 | 109 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 110 | params/volume_db = 10.0 111 | params/pitch_scale = 1.0 112 | params/attenuation/min_distance = 1.0 113 | params/attenuation/max_distance = 100.0 114 | params/attenuation/distance_exp = 1.0 115 | params/emission_cone/degrees = 180.0 116 | params/emission_cone/attenuation_db = -6.0 117 | config/polyphony = 1 118 | config/samples = SubResource( 2 ) 119 | 120 | [node name="trajectory" type="ImmediateGeometry" parent="."] 121 | 122 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 123 | layers = 1 124 | geometry/visible = true 125 | geometry/material_override = SubResource( 3 ) 126 | geometry/cast_shadow = 0 127 | geometry/receive_shadows = false 128 | geometry/range_begin = 0.0 129 | geometry/range_end = 0.0 130 | geometry/extra_cull_margin = 0.0 131 | geometry/billboard = false 132 | geometry/billboard_y = false 133 | geometry/depth_scale = false 134 | geometry/visible_in_all_rooms = false 135 | geometry/use_baked_light = false 136 | geometry/baked_light_tex_id = 0 137 | 138 | 139 | -------------------------------------------------------------------------------- /scripts/globals.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var game; 4 | var gui; 5 | var env; 6 | var player; 7 | 8 | const CONFIG_PATH = "user://config.dat"; 9 | var config_var = []; 10 | 11 | var cfg_fpscap; 12 | var cfg_shadow; 13 | var cfg_grassintensity; 14 | var cfg_grassshadow; 15 | var cfg_chunksize; 16 | var cfg_lowprocessmode; 17 | var cfg_fxaa; 18 | var cfg_glow; 19 | var cfg_fog; 20 | var cfg_showfps; 21 | var cfg_timecyclefps; 22 | var cfg_caminterpolation; 23 | 24 | const ENCRYPTED_SAVEGAME = false; 25 | const SAVEGAME_PATH = "user://savegame.dat"; 26 | const SAVEGAME_PASSWORD = "hueheueh"; 27 | var savedata_var = []; 28 | 29 | var world_seeds; 30 | var world_time; 31 | var player_health; 32 | var player_dying; 33 | var player_pos; 34 | var player_exp; 35 | var player_lvl; 36 | var player_tomato; 37 | var skill_point; 38 | var skill_run; 39 | var skill_jump; 40 | var skill_throw; 41 | var skill_pocket; 42 | var skill_health; 43 | var skill_medic; 44 | var zombies_killed; 45 | 46 | func _init(): 47 | randomize(); 48 | 49 | cfg_fpscap = 60.0; 50 | cfg_shadow = true; 51 | cfg_grassintensity = 1.0; 52 | cfg_grassshadow = true; 53 | cfg_chunksize = 4; 54 | cfg_lowprocessmode = false; 55 | cfg_fxaa = true; 56 | cfg_glow = true; 57 | cfg_fog = true; 58 | cfg_showfps = false; 59 | cfg_timecyclefps = 10.0; 60 | cfg_caminterpolation = true; 61 | 62 | config_var.push_back("cfg_fpscap"); 63 | config_var.push_back("cfg_shadow"); 64 | config_var.push_back("cfg_grassintensity"); 65 | config_var.push_back("cfg_grassshadow"); 66 | config_var.push_back("cfg_chunksize"); 67 | config_var.push_back("cfg_lowprocessmode"); 68 | config_var.push_back("cfg_fxaa"); 69 | config_var.push_back("cfg_glow"); 70 | config_var.push_back("cfg_fog"); 71 | config_var.push_back("cfg_showfps"); 72 | config_var.push_back("cfg_timecyclefps"); 73 | config_var.push_back("cfg_caminterpolation"); 74 | 75 | world_seeds = int(OS.get_unix_time()); 76 | world_time = 8.0; 77 | player_health = 100.0; 78 | player_dying = false; 79 | player_tomato = 1; 80 | player_pos = Vector3(); 81 | player_lvl = 1; 82 | player_exp = 0; 83 | skill_point = 0; 84 | skill_run = 0.0; 85 | skill_jump = 0.0; 86 | skill_throw = 0.0; 87 | skill_pocket = 0.0; 88 | skill_health = 0.0; 89 | skill_medic = 0.0; 90 | zombies_killed = []; 91 | 92 | savedata_var.push_back("world_time"); 93 | savedata_var.push_back("world_seeds"); 94 | savedata_var.push_back("player_health"); 95 | savedata_var.push_back("player_dying"); 96 | savedata_var.push_back("player_pos"); 97 | savedata_var.push_back("player_tomato"); 98 | savedata_var.push_back("player_lvl"); 99 | savedata_var.push_back("player_exp"); 100 | savedata_var.push_back("skill_point"); 101 | savedata_var.push_back("skill_run"); 102 | savedata_var.push_back("skill_jump"); 103 | savedata_var.push_back("skill_throw"); 104 | savedata_var.push_back("skill_pocket"); 105 | savedata_var.push_back("skill_health"); 106 | savedata_var.push_back("skill_medic"); 107 | savedata_var.push_back("zombies_killed"); 108 | 109 | func _ready(): 110 | get_tree().set_auto_accept_quit(false); 111 | 112 | func quit_game(): 113 | save_config(); 114 | save_game(); 115 | get_tree().quit(); 116 | 117 | func serialize_data(d, variable): 118 | d[variable] = var2str(get(variable)); 119 | 120 | func parse_data(d, variable): 121 | if d.has(variable): 122 | set(variable, str2var(d[variable])); 123 | 124 | func save_config(): 125 | var data = {}; 126 | for i in config_var: 127 | serialize_data(data, i); 128 | data = data.to_json(); 129 | 130 | var f = File.new(); 131 | f.open(CONFIG_PATH, f.WRITE); 132 | f.store_string(data); 133 | f.close(); 134 | 135 | func load_config(): 136 | var f = File.new(); 137 | if !f.file_exists(CONFIG_PATH): 138 | print("File isn't exists: ",CONFIG_PATH); 139 | return; 140 | f.open(CONFIG_PATH, f.READ); 141 | var data = {}; 142 | data.parse_json(f.get_as_text()); 143 | f.close(); 144 | 145 | for i in config_var: 146 | parse_data(data, i); 147 | 148 | func save_game(): 149 | var data = {}; 150 | for i in savedata_var: 151 | serialize_data(data, i); 152 | data = data.to_json(); 153 | 154 | var f = File.new(); 155 | if ENCRYPTED_SAVEGAME: 156 | f.open_encrypted_with_pass(SAVEGAME_PATH, f.WRITE, str(SAVEGAME_PASSWORD).md5_text()); 157 | else: 158 | f.open(SAVEGAME_PATH, f.WRITE); 159 | f.store_string(data); 160 | f.close(); 161 | 162 | func load_game(): 163 | var f = File.new(); 164 | if !f.file_exists(SAVEGAME_PATH): 165 | print("File isn't exists: ",SAVEGAME_PATH); 166 | return; 167 | if ENCRYPTED_SAVEGAME: 168 | f.open_encrypted_with_pass(SAVEGAME_PATH, f.READ, str(SAVEGAME_PASSWORD).md5_text()); 169 | else: 170 | f.open(SAVEGAME_PATH, f.READ); 171 | var data = {}; 172 | data.parse_json(f.get_as_text()); 173 | f.close(); 174 | 175 | for i in savedata_var: 176 | parse_data(data, i); 177 | -------------------------------------------------------------------------------- /scripts/levels.gd: -------------------------------------------------------------------------------- 1 | extends Spatial 2 | 3 | var world_seed; 4 | var noise = preload("res://scripts/perlin_noise.gd"); 5 | 6 | const CHUNK_DISTANCE = 20.0; 7 | var player_pos = Vector2(); 8 | var chunks = []; 9 | 10 | var obj_platform = "res://models/platform/grass_platform.scn"; 11 | var obj_tree = ["res://models/props/tree/tree.scn","res://models/props/tree/tree1.scn","res://models/props/tree/pine_tree.scn"]; 12 | var obj_stone = ["res://models/props/stone/stone.scn","res://models/props/stone/stone1.scn","res://models/props/stone/stone2.scn"]; 13 | var obj_base = "res://models/props/base/base.scn"; 14 | var scn_zombie = "res://scenes/zombie.tscn"; 15 | var grass_mesh = "res://models/props/grass/grass.msh"; 16 | 17 | func _ready(): 18 | obj_platform = load(obj_platform); 19 | for i in range(obj_tree.size()): 20 | obj_tree[i] = load(obj_tree[i]); 21 | for i in range(obj_stone.size()): 22 | obj_stone[i] = load(obj_stone[i]); 23 | obj_base = load(obj_base); 24 | scn_zombie = load(scn_zombie); 25 | grass_mesh = load(grass_mesh); 26 | 27 | func generate_world(seeds): 28 | world_seed = seeds; 29 | noise = noise.new(); 30 | noise.set_seed(world_seed); 31 | 32 | chunks = get_chunkneighboor(pos2chunks(globals.player_pos)); 33 | 34 | for i in chunks: 35 | generate_chunk(i); 36 | 37 | set_fixed_process(true); 38 | 39 | func pos2chunks(pos): 40 | return Vector2(stepify(pos.x, CHUNK_DISTANCE)/CHUNK_DISTANCE, stepify(pos.z, CHUNK_DISTANCE)/CHUNK_DISTANCE); 41 | 42 | func get_chunkneighboor(center): 43 | var chunks = []; 44 | for x in range(center.x-((get_chunk_size()-1)/2), center.x+((get_chunk_size()-1)/2)+1): 45 | for y in range(center.y-((get_chunk_size()-1)/2), center.y+((get_chunk_size()-1)/2)+1): 46 | chunks.push_back(Vector2(x, y)); 47 | return chunks; 48 | 49 | func get_chunk_size(): 50 | return int(clamp(globals.cfg_chunksize, 1, 10))*2+1; 51 | 52 | func generate_chunk(chunk_pos): 53 | var chunk = Spatial.new(); 54 | var pos = Vector3(chunk_pos.x*CHUNK_DISTANCE, -20, chunk_pos.y*CHUNK_DISTANCE); 55 | chunk.set_name(str("chunk_",int(chunk_pos.x),"_",int(chunk_pos.y))); 56 | var xforsim = pos.x/100.0+40; 57 | var yforsim = pos.z/100.0+2000; 58 | var worldHeight = ((noise.noise(xforsim,yforsim,0)+1)*0.5) * 16; 59 | pos.y += ceil(worldHeight)*2; 60 | chunk.set_translation(pos); 61 | 62 | var platform = obj_platform.instance(); 63 | chunk.add_child(platform, true); 64 | seed(world_seed+(chunk_pos.x*2)+(chunk_pos.y*4)); 65 | rand_range(10, 100); 66 | 67 | var spawn_base = rand_range(10, 100) > 85; 68 | 69 | for i in range(6): 70 | var pos = Vector3(rand_range(-8.0,8.0), 0, rand_range(-8.0,8.0)); 71 | 72 | if rand_range(10, 100) > 50 && (!spawn_base || (spawn_base && !Rect2(-10,-10,10,10).has_point(Vector2(pos.x, pos.z)))): 73 | add_object(chunk, obj_tree[rand_range(0, obj_tree.size())], \ 74 | pos, \ 75 | Vector3(0, rand_range(0.0, 360.0), 0), \ 76 | Vector3(1,1,1)*rand_range(1.0, 2.0)); 77 | 78 | if rand_range(10, 100) > 20: 79 | add_object(chunk, obj_stone[rand_range(0, obj_stone.size())], \ 80 | Vector3(rand_range(-8.0,8.0), 0, rand_range(-8.0,8.0)), \ 81 | Vector3(0, rand_range(0.0, 360.0), 0), \ 82 | Vector3(1,1,1)*rand_range(0.8, 1.5)); 83 | 84 | var inst = MultiMeshInstance.new(); 85 | inst.set_name("grass"); 86 | var multimesh = MultiMesh.new(); 87 | multimesh.set_mesh(grass_mesh); 88 | multimesh.set_instance_count(rand_range(64*globals.cfg_grassintensity,128*globals.cfg_grassintensity)); 89 | 90 | for i in range(multimesh.get_instance_count()): 91 | var trans = Transform(); 92 | trans = trans.scaled(Vector3(1,1,1)*rand_range(0.8, 1.5)); 93 | trans = trans.rotated(Vector3(0,1,0), deg2rad(rand_range(0.0, 360.0))); 94 | trans.origin = Vector3(rand_range(-8.0,8.0), 0, rand_range(-8.0,8.0)); 95 | multimesh.set_instance_transform(i, trans); 96 | 97 | multimesh.generate_aabb(); 98 | inst.set_multimesh(multimesh); 99 | if globals.cfg_grassshadow: 100 | inst.set_flag(GeometryInstance.FLAG_CAST_SHADOW, 2); 101 | else: 102 | inst.set_flag(GeometryInstance.FLAG_CAST_SHADOW, 0); 103 | chunk.add_child(inst, true); 104 | 105 | if spawn_base: 106 | add_object(chunk, obj_base, Vector3(-4, 0, -4)); 107 | if globals.zombies_killed.find([chunk_pos.x, chunk_pos.y]) < 0: 108 | var obj = add_object(chunk, scn_zombie, Vector3(-2,1,-2)); 109 | obj.chunk = [chunk_pos.x, chunk_pos.y]; 110 | 111 | elif rand_range(10, 100) > 60 && globals.zombies_killed.find([chunk_pos.x, chunk_pos.y]) < 0: 112 | var obj = add_object(chunk, scn_zombie, Vector3(rand_range(-6.0,6.0), 0, rand_range(-6.0,6.0))); 113 | obj.chunk = [chunk_pos.x, chunk_pos.y]; 114 | 115 | add_child(chunk, false); 116 | 117 | func _fixed_process(delta): 118 | chunks_update(); 119 | 120 | func chunks_update(): 121 | var pos = get_viewport().get_camera().get_global_transform().origin; 122 | if has_node("../player"): 123 | pos = get_node("../player").get_global_transform().origin; 124 | var cur_pos = Vector2(stepify(pos.x, CHUNK_DISTANCE)/CHUNK_DISTANCE, stepify(pos.z, CHUNK_DISTANCE)/CHUNK_DISTANCE); 125 | 126 | if cur_pos.x != player_pos.x || cur_pos.y != player_pos.y: 127 | chunk_generate(pos); 128 | 129 | player_pos = cur_pos; 130 | 131 | func chunk_generate(pos): 132 | var old_chunks = chunks; 133 | var new_chunks = get_chunkneighboor(pos2chunks(pos)); 134 | 135 | for i in new_chunks: 136 | if chunks.find(i) <= -1: 137 | generate_chunk(i); 138 | old_chunks.erase(i); 139 | 140 | for i in old_chunks: 141 | var node = "chunk_"+str(i.x)+"_"+str(i.y); 142 | if has_node(node): 143 | node = get_node(node); 144 | remove_child(node); 145 | node.free(); 146 | 147 | chunks = new_chunks; 148 | 149 | func add_object(parent, scn, pos = Vector3(), rot = Vector3(), scl = Vector3(1,1,1), etc = null): 150 | var inst = scn.instance(); 151 | if inst == null: 152 | return null; 153 | 154 | inst.set_translation(pos); 155 | inst.set_rotation_deg(rot); 156 | inst.set_scale(scl); 157 | parent.add_child(inst, true); 158 | return inst; 159 | -------------------------------------------------------------------------------- /scripts/game.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | const SKILL_COST = 5; 4 | 5 | var time = 0.0; 6 | var spawn_point = Vector3(); 7 | 8 | var list_skill_scn = "res://scenes/skill_list.tscn"; 9 | var skill_run; 10 | var skill_jump; 11 | var skill_throw; 12 | var skill_pocket; 13 | var skill_health; 14 | var skill_medic; 15 | 16 | var next_tomato_reload = 0.0; 17 | 18 | func _ready(): 19 | globals.game = self; 20 | globals.gui = get_node("gui"); 21 | globals.env = get_node("env"); 22 | 23 | globals.load_config(); 24 | globals.load_game(); 25 | 26 | OS.set_target_fps(globals.cfg_fpscap); 27 | OS.set_low_processor_usage_mode(globals.cfg_lowprocessmode); 28 | 29 | next_tomato_reload = 8.0; 30 | 31 | init_gui(); 32 | construct_level(); 33 | spawn_player(); 34 | init_skills(); 35 | 36 | set_process(true); 37 | set_process_input(true); 38 | 39 | func _notification(what): 40 | if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST: 41 | key_escape(); 42 | 43 | func _input(ie): 44 | if ie.type == InputEvent.KEY && ie.pressed: 45 | if ie.scancode == KEY_ESCAPE: 46 | key_escape(); 47 | 48 | func key_escape(): 49 | if get_node("gui/skill_window").is_visible(): 50 | toggle_skillmenu(false); 51 | else: 52 | toggle_menu(); 53 | 54 | var f = get_node("gui/fx_blur").get_focus_owner(); 55 | if f != null: 56 | f.release_focus(); 57 | 58 | func init_gui(): 59 | get_node("gui/fx_blur").hide(); 60 | get_node("gui/fx_blood_splat").hide(); 61 | get_node("gui/msgbox").hide(); 62 | get_node("gui/skill_window").hide(); 63 | get_node("gui/menu_window").hide(); 64 | get_node("gui/notification_hud").hide(); 65 | 66 | if !globals.cfg_showfps: 67 | get_node("gui/fps_counter").hide(); 68 | get_node("gui/fps_counter").set_process(false); 69 | 70 | func on_pause_btn_pressed(): 71 | key_escape(); 72 | 73 | func toggle_menu(set = !get_node("gui/menu_window").is_visible()): 74 | if set: 75 | get_node("gui/fx_blur").show(); 76 | get_node("gui/menu_window").show(); 77 | globals.player.cam.set_active(false); 78 | else: 79 | get_node("gui/fx_blur").hide(); 80 | get_node("gui/menu_window").hide() 81 | globals.player.cam.set_active(true); 82 | 83 | func toggle_skillmenu(set = !get_node("gui/skill_window").is_visible()): 84 | if set: 85 | get_node("gui/fx_blur").show(); 86 | get_node("gui/skill_window").show(); 87 | globals.player.cam.set_active(false); 88 | else: 89 | get_node("gui/fx_blur").hide(); 90 | get_node("gui/skill_window").hide() 91 | globals.player.cam.set_active(true); 92 | 93 | func _process(delta): 94 | if get_tree().is_paused(): 95 | return; 96 | time += delta; 97 | 98 | if !globals.player_dying: 99 | player_apply_damage((0.5-0.5*globals.skill_medic)*delta, true); 100 | get_node("gui/health_hud/health_bar").set_value(globals.player_health/float(100+(100*globals.skill_health))*100.0); 101 | 102 | if time >= next_tomato_reload && !globals.player_dying: 103 | globals.player_tomato = int(clamp(globals.player_tomato+1, 0, 8+(3*globals.skill_pocket))); 104 | next_tomato_reload = time+8.0-2*globals.skill_pocket; 105 | 106 | if globals.player_tomato > 0: 107 | get_node("gui/health_hud/tomato").show(); 108 | get_node("gui/health_hud/tomato").set_size(Vector2(15*int(globals.player_tomato),14)); 109 | else: 110 | get_node("gui/health_hud/tomato").hide(); 111 | 112 | func change_level(to): 113 | globals.world_level = to; 114 | globals.save_game(); 115 | get_tree().reload_current_scene(); 116 | 117 | func restart_level(): 118 | get_tree().reload_current_scene(); 119 | 120 | func construct_level(): 121 | get_node("env").add_child(load("res://scenes/scenery.tscn").instance()); 122 | get_node("env/levels").generate_world(globals.world_seeds); 123 | 124 | func spawn_player(): 125 | var inst = load("res://scenes/player.tscn").instance(); 126 | inst.set_translation(globals.player_pos+Vector3(0,1,0)); 127 | get_node("env").add_child(inst, true); 128 | globals.player = inst; 129 | 130 | func init_skills(): 131 | list_skill_scn = load(list_skill_scn); 132 | var c = get_node("gui/skill_window/container/list"); 133 | 134 | skill_run = add_skill(c, "Run", "skill_run"); 135 | skill_jump = add_skill(c, "Jump", "skill_jump"); 136 | skill_throw = add_skill(c, "Throw", "skill_throw"); 137 | skill_pocket = add_skill(c, "Pocket", "skill_pocket"); 138 | skill_health = add_skill(c, "Health", "skill_health"); 139 | skill_medic = add_skill(c, "Medic", "skill_medic"); 140 | 141 | func add_skill(container, name, global_var): 142 | var inst = list_skill_scn.instance(); 143 | inst.global_var = global_var; 144 | container.add_child(inst); 145 | set_skill_name(inst, name); 146 | set_skill_val(inst, globals.get(global_var)); 147 | return inst; 148 | 149 | func set_skill_name(inst, name): 150 | inst.name = name; 151 | inst.get_node("lbl").set_text(str(name, " (", int(inst.val*10), "/10)")); 152 | 153 | func set_skill_val(inst, value): 154 | inst.val = value; 155 | inst.get_node("lbl").set_text(str(inst.name, " (", int(value*10), "/10)")); 156 | inst.get_node("progress").set_value(round(float(value)*100)); 157 | 158 | func skill_upgrade(inst, skill): 159 | if !skill_can_upgrade(skill): 160 | return; 161 | 162 | var val = globals.get(skill)+0.1; 163 | globals.set(skill, val); 164 | set_skill_val(inst, val); 165 | globals.skill_point -= SKILL_COST; 166 | 167 | func skill_can_upgrade(skill): 168 | if globals.skill_point < SKILL_COST: 169 | return false; 170 | var val = globals.get(skill); 171 | if val >= 1.0: 172 | return false; 173 | 174 | return true; 175 | 176 | func popup_notification(txt): 177 | get_node("gui/notification_hud").popup_notification(txt); 178 | 179 | func player_give_exp(exps): 180 | globals.player_exp += exps; 181 | 182 | if globals.player_exp >= (100*globals.player_lvl): 183 | globals.player_exp = 0; 184 | globals.player_lvl += 1; 185 | globals.skill_point += 5; 186 | 187 | popup_notification(str("Level up to ",globals.player_lvl,"! SP +5")); 188 | 189 | func player_apply_damage(dmg, hide_bloodsplat = false): 190 | globals.player_health = clamp(globals.player_health-dmg, 0.0, float(100+(100*globals.skill_health))); 191 | 192 | if dmg > 0 && !hide_bloodsplat: 193 | globals.gui.get_node("fx_blood_splat/AnimationPlayer").play("splat"); 194 | 195 | if globals.player_health <= 0.0: 196 | player_kill(); 197 | 198 | func player_kill(): 199 | globals.player_dying = true; 200 | globals.player.next_idle = globals.game.time; 201 | globals.player.aiming = false; 202 | #globals.player.cam.set_active(false); 203 | 204 | popup_notification("Game over!"); 205 | 206 | -------------------------------------------------------------------------------- /scripts/player.gd: -------------------------------------------------------------------------------- 1 | extends KinematicBody 2 | 3 | # Member variables 4 | var g = -19.6; 5 | var vel = Vector3(); 6 | 7 | # Constants 8 | const MOVE_SPEED = 5.0; 9 | const MAX_SPEED = 8.0; 10 | const ACCEL = 10; 11 | const DEACCEL = 16; 12 | const MAX_SLOPE_ANGLE = 30; 13 | const JUMP_FORCE = 10; 14 | const JUMP_MAX = 12; 15 | const ATTACK_DELAY = 0.5; 16 | const FALLATTACK_FORCE = 20.0; 17 | 18 | var cam = null; 19 | var on_floor = false; 20 | var can_doublejump = false; 21 | var next_idle = 0.0; 22 | var next_attack = 0.0; 23 | var body_yaw = 0.0; 24 | var aiming = false; 25 | var projectile = preload("res://scripts/projectile.gd"); 26 | 27 | var tomato = "res://scenes/tomato.tscn"; 28 | 29 | func _ready(): 30 | cam = get_node("cam"); 31 | tomato = load(tomato); 32 | projectile = projectile.new(); 33 | 34 | get_node("trajectory").get_material_override().set_line_width(3); 35 | cam.excl.push_back(self); 36 | cam.set_active(true); 37 | 38 | set_process_input(true); 39 | set_fixed_process(true); 40 | 41 | func _input(ie): 42 | if ie.type == InputEvent.KEY: 43 | if ie.scancode == KEY_SPACE && ie.pressed: 44 | jump(); 45 | 46 | if ie.type == InputEvent.MOUSE_BUTTON: 47 | if ie.button_index == BUTTON_LEFT && ie.pressed && aiming: 48 | attack(); 49 | 50 | if ie.button_index == BUTTON_RIGHT && ie.pressed && !globals.player_dying: 51 | aiming = !aiming; 52 | 53 | func jump(): 54 | if aiming || globals.player_dying: 55 | return; 56 | 57 | if on_floor: 58 | vel.y = JUMP_FORCE+(JUMP_MAX-JUMP_FORCE)*globals.skill_jump; 59 | can_doublejump = true; 60 | elif !on_floor && can_doublejump: 61 | vel.y = JUMP_FORCE+(JUMP_MAX-JUMP_FORCE)*globals.skill_jump; 62 | can_doublejump = false; 63 | else: 64 | vel.y = -FALLATTACK_FORCE; 65 | 66 | func _fixed_process(delta): 67 | var dir = Vector3(); 68 | var aim = cam.get_global_transform().basis; 69 | 70 | if Input.is_key_pressed(KEY_A): 71 | dir -= aim[0]; 72 | if Input.is_key_pressed(KEY_D): 73 | dir += aim[0]; 74 | if Input.is_key_pressed(KEY_W): 75 | dir -= aim[2]; 76 | if Input.is_key_pressed(KEY_S): 77 | dir += aim[2]; 78 | 79 | dir.y = 0; 80 | dir = dir.normalized(); 81 | 82 | if aiming || globals.player_dying: 83 | dir = Vector3(); 84 | 85 | if dir.length() > 0.0: 86 | body_yaw = -atan2(dir.x, dir.z); 87 | 88 | vel.y += g*delta 89 | var hvel = vel 90 | hvel.y = 0 91 | 92 | var move_speed = MOVE_SPEED+((MAX_SPEED-MOVE_SPEED)*globals.skill_run); 93 | var target = dir*move_speed; 94 | var accel 95 | if (dir.dot(hvel) > 0): 96 | accel = ACCEL 97 | else: 98 | accel = DEACCEL 99 | 100 | hvel = hvel.linear_interpolate(target, accel*delta) 101 | 102 | vel.x = hvel.x 103 | vel.z = hvel.z 104 | 105 | var motion = move(vel*delta) 106 | on_floor = false 107 | var original_vel = vel 108 | var floor_velocity = Vector3() 109 | var attempts = 4 110 | 111 | while(is_colliding() and attempts): 112 | var n = get_collision_normal(); 113 | var p = get_collision_pos(); 114 | var collider = get_collider(); 115 | 116 | if collider extends RigidBody: 117 | collider.apply_impulse(p-collider.get_global_transform().origin, -n*collider.get_mass()); 118 | 119 | if vel.y <= -FALLATTACK_FORCE: 120 | get_node("sfx").play("jumpland"); 121 | 122 | if collider extends preload("res://scripts/box.gd"): 123 | collider.destroy(); 124 | if collider extends preload("res://scripts/zombie.gd"): 125 | collider.kill(); 126 | globals.game.player_give_exp(40); 127 | globals.game.player_apply_damage(-25); 128 | 129 | if (rad2deg(acos(n.dot(Vector3(0, 1, 0)))) < MAX_SLOPE_ANGLE): 130 | # If angle to the "up" vectors is < angle tolerance, 131 | # char is on floor 132 | floor_velocity = get_collider_velocity() 133 | on_floor = true 134 | 135 | motion = n.slide(motion) 136 | vel = n.slide(vel) 137 | if (original_vel.dot(vel) > 0): 138 | # Do not allow to slide towads the opposite direction we were coming from 139 | motion=move(motion) 140 | if (motion.length() < 0.001): 141 | break 142 | attempts -= 1 143 | 144 | if (on_floor and floor_velocity != Vector3()): 145 | move(floor_velocity*delta) 146 | 147 | var trans = get_transform(); 148 | var byaw = body_yaw; 149 | if aiming && !globals.player_dying: 150 | byaw = deg2rad(-cam.cyaw+180); 151 | trans.basis = Matrix3(Quat(trans.basis).slerp(Quat(Vector3(0,1,0), byaw), 10*delta)); 152 | set_transform(trans); 153 | 154 | if globals.game.time > next_idle: 155 | next_idle = globals.game.time + 0.1; 156 | 157 | if globals.player_dying: 158 | set_animation("died"); 159 | elif dir.length() >= 0.5 && on_floor: 160 | set_animation("run", false, move_speed/float(MOVE_SPEED)); 161 | elif vel.y > 0 && !on_floor: 162 | set_animation("jump"); 163 | elif vel.y < 0 && !on_floor: 164 | set_animation("fall"); 165 | elif aiming: 166 | set_animation("pre_shoot"); 167 | else: 168 | set_animation("idle"); 169 | 170 | update_trajectory(); 171 | globals.player_pos = get_global_transform().origin; 172 | 173 | func update_trajectory(): 174 | var mesh = get_node("trajectory"); 175 | if !aiming || globals.player_dying: 176 | mesh.hide(); 177 | return; 178 | 179 | mesh.show(); 180 | var begin = Vector3(0,0.8,1); 181 | var angle = cam.pitch-40; 182 | projectile.velocity = Vector2(20,0).rotated(deg2rad(angle)); 183 | projectile.startpoint = Vector2(begin.z, begin.y); 184 | 185 | mesh.clear(); 186 | mesh.begin(Mesh.PRIMITIVE_LINE_STRIP, null); 187 | 188 | var time = 0.0; 189 | for i in range(20): 190 | var pos = Vector2(projectile.getX(time), projectile.getY(time)); 191 | mesh.add_vertex(Vector3(0,pos.y,pos.x)); 192 | time += 0.1; 193 | 194 | mesh.end(); 195 | 196 | func set_animation(ani, force = false, speed = 1.0): 197 | var ap = get_node("models/animations"); 198 | if ap.get_current_animation() != ani || force: 199 | ap.play(ani); 200 | ap.set_speed(speed); 201 | 202 | func attack(): 203 | if globals.game.time < next_attack || globals.player_tomato <= 0: 204 | return; 205 | 206 | next_attack = globals.game.time+ATTACK_DELAY; 207 | globals.player_tomato -= 1; 208 | globals.game.player_give_exp(5); 209 | 210 | var aim = (Vector3()-cam.get_global_transform().basis[2]).normalized(); 211 | var inst = tomato.instance(); 212 | inst.owner = self; 213 | inst.set_translation(get_translation()+aim+Vector3(0,1.5,0)); 214 | inst.apply_impulse(Vector3(), aim*(20+5*globals.skill_throw)+Vector3(0,5,0)); 215 | inst.set_angular_velocity(Vector3(1,1,1)*deg2rad(360)); 216 | globals.env.add_child(inst, true); 217 | 218 | set_animation("shoot", true); 219 | next_idle = next_attack; 220 | -------------------------------------------------------------------------------- /export.cfg: -------------------------------------------------------------------------------- 1 | [convert_images] 2 | 3 | action="none" 4 | compress_quality=0.7 5 | formats="png" 6 | shrink=1.0 7 | 8 | [convert_samples] 9 | 10 | action="none" 11 | max_hz=44100 12 | trim=false 13 | 14 | [convert_scenes] 15 | 16 | convert_text_scenes=true 17 | 18 | [export_filter] 19 | 20 | filter="" 21 | filter_exclude="" 22 | type="resources" 23 | 24 | [platform:Android] 25 | 26 | apk_expansion/SALT="" 27 | apk_expansion/enable=false 28 | apk_expansion/public_key="" 29 | architecture/arm=true 30 | architecture/x86=false 31 | command_line/extra_args="" 32 | custom_package/debug="" 33 | custom_package/release="" 34 | debug/debugging_enabled=false 35 | keystore/release="/home/khairul/debug.keystore" 36 | keystore/release_password="android" 37 | keystore/release_user="androiddebugkey" 38 | one_click_deploy/clear_previous_install=true 39 | package/icon="res://icon.png" 40 | package/name="Cubiventure" 41 | package/signed=true 42 | package/unique_name="org.godotengine.cubiventure" 43 | permissions/access_checkin_properties=false 44 | permissions/access_coarse_location=false 45 | permissions/access_fine_location=false 46 | permissions/access_location_extra_commands=false 47 | permissions/access_mock_location=false 48 | permissions/access_network_state=false 49 | permissions/access_surface_flinger=false 50 | permissions/access_wifi_state=false 51 | permissions/account_manager=false 52 | permissions/add_voicemail=false 53 | permissions/authenticate_accounts=false 54 | permissions/battery_stats=false 55 | permissions/bind_accessibility_service=false 56 | permissions/bind_appwidget=false 57 | permissions/bind_device_admin=false 58 | permissions/bind_input_method=false 59 | permissions/bind_nfc_service=false 60 | permissions/bind_notification_listener_service=false 61 | permissions/bind_print_service=false 62 | permissions/bind_remoteviews=false 63 | permissions/bind_text_service=false 64 | permissions/bind_vpn_service=false 65 | permissions/bind_wallpaper=false 66 | permissions/bluetooth=false 67 | permissions/bluetooth_admin=false 68 | permissions/bluetooth_privileged=false 69 | permissions/brick=false 70 | permissions/broadcast_package_removed=false 71 | permissions/broadcast_sms=false 72 | permissions/broadcast_sticky=false 73 | permissions/broadcast_wap_push=false 74 | permissions/call_phone=false 75 | permissions/call_privileged=false 76 | permissions/camera=false 77 | permissions/capture_audio_output=false 78 | permissions/capture_secure_video_output=false 79 | permissions/capture_video_output=false 80 | permissions/change_component_enabled_state=false 81 | permissions/change_configuration=false 82 | permissions/change_network_state=false 83 | permissions/change_wifi_multicast_state=false 84 | permissions/change_wifi_state=false 85 | permissions/clear_app_cache=false 86 | permissions/clear_app_user_data=false 87 | permissions/control_location_updates=false 88 | permissions/delete_cache_files=false 89 | permissions/delete_packages=false 90 | permissions/device_power=false 91 | permissions/diagnostic=false 92 | permissions/disable_keyguard=false 93 | permissions/dump=false 94 | permissions/expand_status_bar=false 95 | permissions/factory_test=false 96 | permissions/flashlight=false 97 | permissions/force_back=false 98 | permissions/get_accounts=false 99 | permissions/get_package_size=false 100 | permissions/get_tasks=false 101 | permissions/get_top_activity_info=false 102 | permissions/global_search=false 103 | permissions/hardware_test=false 104 | permissions/inject_events=false 105 | permissions/install_location_provider=false 106 | permissions/install_packages=false 107 | permissions/install_shortcut=false 108 | permissions/internal_system_window=false 109 | permissions/internet=false 110 | permissions/kill_background_processes=false 111 | permissions/location_hardware=false 112 | permissions/manage_accounts=false 113 | permissions/manage_app_tokens=false 114 | permissions/manage_documents=false 115 | permissions/master_clear=false 116 | permissions/media_content_control=false 117 | permissions/modify_audio_settings=false 118 | permissions/modify_phone_state=false 119 | permissions/mount_format_filesystems=false 120 | permissions/mount_unmount_filesystems=false 121 | permissions/nfc=false 122 | permissions/persistent_activity=false 123 | permissions/process_outgoing_calls=false 124 | permissions/read_calendar=false 125 | permissions/read_call_log=false 126 | permissions/read_contacts=false 127 | permissions/read_external_storage=false 128 | permissions/read_frame_buffer=false 129 | permissions/read_history_bookmarks=false 130 | permissions/read_input_state=false 131 | permissions/read_logs=false 132 | permissions/read_phone_state=false 133 | permissions/read_profile=false 134 | permissions/read_sms=false 135 | permissions/read_social_stream=false 136 | permissions/read_sync_settings=false 137 | permissions/read_sync_stats=false 138 | permissions/read_user_dictionary=false 139 | permissions/reboot=false 140 | permissions/receive_boot_completed=false 141 | permissions/receive_mms=false 142 | permissions/receive_sms=false 143 | permissions/receive_wap_push=false 144 | permissions/record_audio=false 145 | permissions/reorder_tasks=false 146 | permissions/restart_packages=false 147 | permissions/send_respond_via_message=false 148 | permissions/send_sms=false 149 | permissions/set_activity_watcher=false 150 | permissions/set_alarm=false 151 | permissions/set_always_finish=false 152 | permissions/set_animation_scale=false 153 | permissions/set_debug_app=false 154 | permissions/set_orientation=false 155 | permissions/set_pointer_speed=false 156 | permissions/set_preferred_applications=false 157 | permissions/set_process_limit=false 158 | permissions/set_time=false 159 | permissions/set_time_zone=false 160 | permissions/set_wallpaper=false 161 | permissions/set_wallpaper_hints=false 162 | permissions/signal_persistent_processes=false 163 | permissions/status_bar=false 164 | permissions/subscribed_feeds_read=false 165 | permissions/subscribed_feeds_write=false 166 | permissions/system_alert_window=false 167 | permissions/transmit_ir=false 168 | permissions/uninstall_shortcut=false 169 | permissions/update_device_stats=false 170 | permissions/use_credentials=false 171 | permissions/use_sip=false 172 | permissions/vibrate=false 173 | permissions/wake_lock=false 174 | permissions/write_apn_settings=false 175 | permissions/write_calendar=false 176 | permissions/write_call_log=false 177 | permissions/write_contacts=false 178 | permissions/write_external_storage=false 179 | permissions/write_gservices=false 180 | permissions/write_history_bookmarks=false 181 | permissions/write_profile=false 182 | permissions/write_secure_settings=false 183 | permissions/write_settings=false 184 | permissions/write_sms=false 185 | permissions/write_social_stream=false 186 | permissions/write_sync_settings=false 187 | permissions/write_user_dictionary=false 188 | screen/immersive_mode=true 189 | screen/orientation=0 190 | screen/support_large=true 191 | screen/support_normal=true 192 | screen/support_small=true 193 | screen/support_xlarge=true 194 | screen/use_32_bits_view=true 195 | user_permissions/0="" 196 | user_permissions/1="" 197 | user_permissions/10="" 198 | user_permissions/11="" 199 | user_permissions/12="" 200 | user_permissions/13="" 201 | user_permissions/14="" 202 | user_permissions/15="" 203 | user_permissions/16="" 204 | user_permissions/17="" 205 | user_permissions/18="" 206 | user_permissions/19="" 207 | user_permissions/2="" 208 | user_permissions/3="" 209 | user_permissions/4="" 210 | user_permissions/5="" 211 | user_permissions/6="" 212 | user_permissions/7="" 213 | user_permissions/8="" 214 | user_permissions/9="" 215 | version/code=1 216 | version/name="1.0" 217 | 218 | [platform:BlackBerry 10] 219 | 220 | debug/debugging_enabled=true 221 | package/category="core.games" 222 | package/custom_template="" 223 | package/description="Game made with Godot Engine" 224 | package/icon="" 225 | package/name="" 226 | package/unique_name="com.godot.noname" 227 | release/author="Cert. Name" 228 | release/author_id="Cert. ID" 229 | version/code=1 230 | version/name="1.0" 231 | 232 | [platform:HTML5] 233 | 234 | browser/enable_run=false 235 | custom_package/debug="" 236 | custom_package/release="" 237 | debug/debugging_enabled=true 238 | html/controls_enabled=true 239 | html/font_family="arial,sans-serif" 240 | html/head_include="" 241 | html/style_include="" 242 | html/title="" 243 | options/memory_size=3 244 | 245 | [platform:Linux X11] 246 | 247 | binary/64_bits=true 248 | custom_binary/debug="" 249 | custom_binary/release="" 250 | debug/debugging_enabled=false 251 | resources/bundle_dependencies_(for_optical_disc)=true 252 | resources/pack_mode=2 253 | 254 | [platform:Mac OSX] 255 | 256 | application/64_bits=false 257 | application/copyright="" 258 | application/fat_bits=false 259 | application/icon="" 260 | application/identifier="com.godot.macgame" 261 | application/info="This Game is Nice" 262 | application/name="" 263 | application/short_version="1.0" 264 | application/signature="godotmacgame" 265 | application/version="1.0" 266 | custom_package/debug="" 267 | custom_package/release="" 268 | debug/debugging_enabled=true 269 | display/high_res=false 270 | 271 | [platform:Windows Desktop] 272 | 273 | binary/64_bits=false 274 | custom_binary/debug="" 275 | custom_binary/release="" 276 | debug/debugging_enabled=false 277 | resources/bundle_dependencies_(for_optical_disc)=false 278 | resources/pack_mode=2 279 | 280 | [script] 281 | 282 | action="compile" 283 | encrypt_key="" 284 | -------------------------------------------------------------------------------- /scenes/game.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=25 format=1] 2 | 3 | [ext_resource path="res://scripts/game.gd" type="Script" id=1] 4 | [ext_resource path="res://sprites/blood_screen.tex" type="Texture" id=2] 5 | [ext_resource path="res://sprites/msgbox.tex" type="Texture" id=3] 6 | [ext_resource path="res://fonts/opensans.fnt" type="BitmapFont" id=4] 7 | [ext_resource path="res://sprites/notification_hud.tex" type="Texture" id=5] 8 | [ext_resource path="res://scripts/notification_hud.gd" type="Script" id=6] 9 | [ext_resource path="res://fonts/opensans_32.fnt" type="BitmapFont" id=7] 10 | [ext_resource path="res://sprites/health_hud.tex" type="Texture" id=8] 11 | [ext_resource path="res://sprites/health_bar.tex" type="Texture" id=9] 12 | [ext_resource path="res://sprites/tomato.tex" type="Texture" id=10] 13 | [ext_resource path="res://sprites/white.tex" type="Texture" id=11] 14 | [ext_resource path="res://sprites/window.tex" type="Texture" id=12] 15 | [ext_resource path="res://scripts/skill_window.gd" type="Script" id=13] 16 | [ext_resource path="res://scripts/menu_window.gd" type="Script" id=14] 17 | [ext_resource path="res://sprites/button_wide.tex" type="Texture" id=15] 18 | [ext_resource path="res://sprites/button_wide_p.tex" type="Texture" id=16] 19 | [ext_resource path="res://sprites/button_wide_h.tex" type="Texture" id=17] 20 | [ext_resource path="res://scripts/levels.gd" type="Script" id=18] 21 | [ext_resource path="res://sounds/ambience/Jewel-Thieves.ogg" type="AudioStream" id=19] 22 | 23 | [sub_resource type="Animation" id=1] 24 | 25 | resource/name = "splat" 26 | length = 1.0 27 | loop = false 28 | step = 0.1 29 | tracks/0/type = "value" 30 | tracks/0/path = NodePath(".:visibility/visible") 31 | tracks/0/interp = 1 32 | tracks/0/imported = false 33 | tracks/0/keys = { "times":FloatArray( 0, 1 ), "transitions":FloatArray( 1, 1 ), "update":1, "values":[ true, false ] } 34 | tracks/1/type = "value" 35 | tracks/1/path = NodePath(".:visibility/opacity") 36 | tracks/1/interp = 1 37 | tracks/1/imported = false 38 | tracks/1/keys = { "times":FloatArray( 0, 0.1, 1 ), "transitions":FloatArray( 1, 1, 1 ), "update":0, "values":[ 0.0, 0.9, 0.0 ] } 39 | 40 | [sub_resource type="Animation" id=2] 41 | 42 | length = 3.0 43 | loop = false 44 | step = 0.1 45 | tracks/0/type = "value" 46 | tracks/0/path = NodePath(".:visibility/opacity") 47 | tracks/0/interp = 1 48 | tracks/0/imported = false 49 | tracks/0/keys = { "times":FloatArray( 0, 0.5, 2.5, 3 ), "transitions":FloatArray( 1, 1, 1, 1 ), "update":0, "values":[ 0.0, 1.0, 1.0, 0.0 ] } 50 | tracks/1/type = "value" 51 | tracks/1/path = NodePath(".:visibility/visible") 52 | tracks/1/interp = 1 53 | tracks/1/imported = false 54 | tracks/1/keys = { "times":FloatArray( 0, 3 ), "transitions":FloatArray( 1, 1 ), "update":1, "values":[ true, false ] } 55 | 56 | [sub_resource type="CanvasItemShader" id=3] 57 | 58 | _code = { "fragment":"float radius = 0.0025;\nvec3 col = vec3(0);\n\ncol+= texscreen(SCREEN_UV+vec2(-radius,-radius));\ncol+= texscreen(SCREEN_UV+vec2(0,-radius));\ncol+= texscreen(SCREEN_UV+vec2(radius,-radius));\n\ncol+= texscreen(SCREEN_UV+vec2(-radius,0));\ncol+= texscreen(SCREEN_UV+vec2(0,0));\ncol+= texscreen(SCREEN_UV+vec2(radius,0));\n\n\ncol+= texscreen(SCREEN_UV+vec2(-radius,radius));\ncol+= texscreen(SCREEN_UV+vec2(0,radius));\ncol+= texscreen(SCREEN_UV+vec2(radius,radius));\n\ncol/=9.0;\nCOLOR.rgb=col*0.5;\n", "fragment_ofs":0, "light":"", "light_ofs":0, "vertex":"", "vertex_ofs":0 } 59 | 60 | [sub_resource type="CanvasItemMaterial" id=4] 61 | 62 | shader/shader = SubResource( 3 ) 63 | shader/shading_mode = 0 64 | 65 | [sub_resource type="GDScript" id=5] 66 | 67 | script/source = "extends Label\n\nfunc _ready():\n\tset_process(true);\n\nfunc _process(delta):\n\tset_text(\"FPS: \"+str(OS.get_frames_per_second()));" 68 | 69 | [node name="game" type="Node"] 70 | 71 | script/script = ExtResource( 1 ) 72 | 73 | [node name="gui" type="CanvasLayer" parent="."] 74 | 75 | layer = 1 76 | offset = Vector2( 0, 0 ) 77 | rotation = 0.0 78 | scale = Vector2( 1, 1 ) 79 | __meta__ = { "_edit_lock_":true } 80 | 81 | [node name="fx_blood_splat" type="TextureFrame" parent="gui"] 82 | 83 | visibility/opacity = 0.0 84 | focus/ignore_mouse = true 85 | focus/stop_mouse = true 86 | size_flags/horizontal = 2 87 | size_flags/vertical = 2 88 | margin/left = 0.0 89 | margin/top = 0.0 90 | margin/right = 1024.0 91 | margin/bottom = 600.0 92 | texture = ExtResource( 2 ) 93 | expand = true 94 | stretch_mode = 0 95 | __meta__ = { "_editor_collapsed":true } 96 | 97 | [node name="AnimationPlayer" type="AnimationPlayer" parent="gui/fx_blood_splat"] 98 | 99 | playback/process_mode = 1 100 | playback/default_blend_time = 0.0 101 | root/root = NodePath("..") 102 | anims/splat = SubResource( 1 ) 103 | playback/active = true 104 | playback/speed = 1.0 105 | blend_times = [ ] 106 | autoplay = "" 107 | 108 | [node name="msgbox" type="TextureFrame" parent="gui"] 109 | 110 | focus/ignore_mouse = true 111 | focus/stop_mouse = true 112 | size_flags/horizontal = 2 113 | size_flags/vertical = 2 114 | margin/left = 0.0 115 | margin/top = 0.0 116 | margin/right = 256.0 117 | margin/bottom = 146.0 118 | texture = ExtResource( 3 ) 119 | stretch_mode = 0 120 | __meta__ = { "_editor_collapsed":true } 121 | 122 | [node name="txt" type="Label" parent="gui/msgbox"] 123 | 124 | focus/ignore_mouse = true 125 | focus/stop_mouse = true 126 | size_flags/horizontal = 2 127 | size_flags/vertical = 0 128 | margin/left = 17.0 129 | margin/top = 19.0 130 | margin/right = 237.0 131 | margin/bottom = 106.0 132 | custom_fonts/font = ExtResource( 4 ) 133 | custom_colors/font_color = Color( 1, 1, 1, 1 ) 134 | text = "NULL" 135 | align = 1 136 | valign = 1 137 | autowrap = true 138 | percent_visible = 1.0 139 | lines_skipped = 0 140 | max_lines_visible = -1 141 | 142 | [node name="notification_hud" type="TextureFrame" parent="gui"] 143 | 144 | anchor/right = 1 145 | focus/ignore_mouse = true 146 | focus/stop_mouse = true 147 | size_flags/horizontal = 2 148 | size_flags/vertical = 2 149 | margin/left = 0.0 150 | margin/top = 120.0 151 | margin/right = 0.0 152 | margin/bottom = 168.0 153 | texture = ExtResource( 5 ) 154 | expand = true 155 | stretch_mode = 0 156 | script/script = ExtResource( 6 ) 157 | __meta__ = { "_edit_lock_":true, "_editor_collapsed":true } 158 | 159 | [node name="txt" type="Label" parent="gui/notification_hud"] 160 | 161 | anchor/right = 1 162 | anchor/bottom = 1 163 | focus/ignore_mouse = true 164 | focus/stop_mouse = true 165 | size_flags/horizontal = 2 166 | size_flags/vertical = 0 167 | margin/left = 0.0 168 | margin/top = 0.0 169 | margin/right = 0.0 170 | margin/bottom = 0.0 171 | custom_fonts/font = ExtResource( 7 ) 172 | text = "Test" 173 | align = 1 174 | valign = 2 175 | percent_visible = 1.0 176 | lines_skipped = 0 177 | max_lines_visible = -1 178 | 179 | [node name="AnimationPlayer" type="AnimationPlayer" parent="gui/notification_hud"] 180 | 181 | playback/process_mode = 1 182 | playback/default_blend_time = 0.0 183 | root/root = NodePath("..") 184 | anims/fade = SubResource( 2 ) 185 | playback/active = true 186 | playback/speed = 1.0 187 | blend_times = [ ] 188 | autoplay = "" 189 | 190 | [node name="health_hud" type="TextureFrame" parent="gui"] 191 | 192 | focus/ignore_mouse = true 193 | focus/stop_mouse = true 194 | size_flags/horizontal = 2 195 | size_flags/vertical = 2 196 | margin/left = 10.0 197 | margin/top = 10.0 198 | margin/right = 337.0 199 | margin/bottom = 119.0 200 | texture = ExtResource( 8 ) 201 | stretch_mode = 0 202 | __meta__ = { "_edit_lock_":true, "_editor_collapsed":true } 203 | 204 | [node name="health_bar" type="TextureProgress" parent="gui/health_hud"] 205 | 206 | focus/ignore_mouse = false 207 | focus/stop_mouse = true 208 | size_flags/horizontal = 2 209 | size_flags/vertical = 2 210 | margin/left = 109.0 211 | margin/top = 25.0 212 | margin/right = 316.0 213 | margin/bottom = 51.0 214 | range/min = 0.0 215 | range/max = 100.0 216 | range/step = 1.0 217 | range/page = 0.0 218 | range/value = 100.0 219 | range/exp_edit = false 220 | range/rounded = false 221 | texture/under = null 222 | texture/over = null 223 | texture/progress = ExtResource( 9 ) 224 | radial_fill/initial_angle = 5.1848e-44 225 | radial_fill/fill_degrees = 360.0 226 | radial_fill/center_offset = Vector2( 0, 0 ) 227 | __meta__ = { "_edit_lock_":true } 228 | 229 | [node name="tomato" type="TextureFrame" parent="gui/health_hud"] 230 | 231 | focus/ignore_mouse = true 232 | focus/stop_mouse = true 233 | size_flags/horizontal = 2 234 | size_flags/vertical = 2 235 | margin/left = 109.0 236 | margin/top = 76.0 237 | margin/right = 124.0 238 | margin/bottom = 90.0 239 | texture = ExtResource( 10 ) 240 | stretch_mode = 2 241 | __meta__ = { "_edit_lock_":true } 242 | 243 | [node name="fx_blur" type="TextureFrame" parent="gui"] 244 | 245 | visibility/visible = false 246 | material/material = SubResource( 4 ) 247 | anchor/right = 1 248 | anchor/bottom = 1 249 | focus/ignore_mouse = true 250 | focus/stop_mouse = true 251 | size_flags/horizontal = 2 252 | size_flags/vertical = 2 253 | margin/left = 0.0 254 | margin/top = 0.0 255 | margin/right = 0.0 256 | margin/bottom = 0.0 257 | texture = ExtResource( 11 ) 258 | expand = true 259 | stretch_mode = 0 260 | __meta__ = { "_edit_lock_":true } 261 | 262 | [node name="skill_window" type="Patch9Frame" parent="gui"] 263 | 264 | visibility/visible = false 265 | anchor/left = 3 266 | anchor/top = 3 267 | anchor/right = 3 268 | anchor/bottom = 3 269 | focus/ignore_mouse = true 270 | focus/stop_mouse = true 271 | size_flags/horizontal = 2 272 | size_flags/vertical = 2 273 | margin/left = 224.0 274 | margin/top = 162.0 275 | margin/right = -224.0 276 | margin/bottom = -162.0 277 | texture = ExtResource( 12 ) 278 | patch_margin/left = 64 279 | patch_margin/top = 64 280 | patch_margin/right = 64 281 | patch_margin/bottom = 64 282 | script/script = ExtResource( 13 ) 283 | __meta__ = { "_edit_lock_":true, "_editor_collapsed":true } 284 | 285 | [node name="title" type="Label" parent="gui/skill_window"] 286 | 287 | anchor/left = 3 288 | anchor/right = 3 289 | focus/ignore_mouse = true 290 | focus/stop_mouse = true 291 | size_flags/horizontal = 2 292 | size_flags/vertical = 0 293 | margin/left = 197.0 294 | margin/top = 25.0 295 | margin/right = 73.0 296 | margin/bottom = 61.0 297 | custom_fonts/font = ExtResource( 7 ) 298 | custom_colors/font_color = Color( 0.640625, 0.640625, 0.640625, 1 ) 299 | text = "Skills" 300 | percent_visible = 1.0 301 | lines_skipped = 0 302 | max_lines_visible = -1 303 | 304 | [node name="sp" type="Label" parent="gui/skill_window"] 305 | 306 | anchor/left = 3 307 | anchor/right = 3 308 | focus/ignore_mouse = true 309 | focus/stop_mouse = true 310 | size_flags/horizontal = 2 311 | size_flags/vertical = 0 312 | margin/left = 98.0 313 | margin/top = 21.0 314 | margin/right = -26.0 315 | margin/bottom = 57.0 316 | custom_fonts/font = ExtResource( 4 ) 317 | custom_colors/font_color = Color( 0.640625, 0.640625, 0.640625, 1 ) 318 | text = "SP: 0" 319 | valign = 2 320 | percent_visible = 1.0 321 | lines_skipped = 0 322 | max_lines_visible = -1 323 | 324 | [node name="container" type="ScrollContainer" parent="gui/skill_window"] 325 | 326 | anchor/left = 3 327 | anchor/top = 1 328 | anchor/right = 3 329 | anchor/bottom = 1 330 | focus/ignore_mouse = false 331 | focus/stop_mouse = true 332 | size_flags/horizontal = 2 333 | size_flags/vertical = 2 334 | margin/left = 197.0 335 | margin/top = 249.0 336 | margin/right = -195.0 337 | margin/bottom = 35.0 338 | scroll/horizontal = false 339 | scroll/vertical = true 340 | __meta__ = { "_editor_collapsed":true } 341 | 342 | [node name="list" type="VBoxContainer" parent="gui/skill_window/container"] 343 | 344 | focus/ignore_mouse = false 345 | focus/stop_mouse = false 346 | size_flags/horizontal = 2 347 | size_flags/vertical = 2 348 | margin/left = 0.0 349 | margin/top = 0.0 350 | margin/right = 0.0 351 | margin/bottom = 0.0 352 | custom_constants/separation = 10 353 | alignment = 0 354 | 355 | [node name="menu_window" type="Patch9Frame" parent="gui"] 356 | 357 | visibility/visible = false 358 | anchor/left = 3 359 | anchor/top = 3 360 | anchor/right = 3 361 | anchor/bottom = 3 362 | focus/ignore_mouse = true 363 | focus/stop_mouse = true 364 | size_flags/horizontal = 2 365 | size_flags/vertical = 2 366 | margin/left = 125.0 367 | margin/top = 150.0 368 | margin/right = -125.0 369 | margin/bottom = -150.0 370 | texture = ExtResource( 12 ) 371 | patch_margin/left = 64 372 | patch_margin/top = 64 373 | patch_margin/right = 64 374 | patch_margin/bottom = 64 375 | script/script = ExtResource( 14 ) 376 | __meta__ = { "_edit_lock_":true, "_editor_collapsed":true } 377 | 378 | [node name="btnReturn" type="TextureButton" parent="gui/menu_window"] 379 | 380 | anchor/left = 3 381 | anchor/top = 3 382 | anchor/right = 3 383 | anchor/bottom = 3 384 | focus/ignore_mouse = false 385 | focus/stop_mouse = true 386 | size_flags/horizontal = 2 387 | size_flags/vertical = 2 388 | margin/left = 93.0 389 | margin/top = 108.0 390 | margin/right = -93.0 391 | margin/bottom = 60.0 392 | toggle_mode = false 393 | enabled_focus_mode = 2 394 | shortcut = null 395 | textures/normal = ExtResource( 15 ) 396 | textures/pressed = ExtResource( 16 ) 397 | textures/hover = ExtResource( 17 ) 398 | __meta__ = { "_editor_collapsed":true } 399 | 400 | [node name="txt" type="Label" parent="gui/menu_window/btnReturn"] 401 | 402 | anchor/right = 1 403 | anchor/bottom = 1 404 | focus/ignore_mouse = true 405 | focus/stop_mouse = true 406 | size_flags/horizontal = 2 407 | size_flags/vertical = 0 408 | margin/left = 0.0 409 | margin/top = 0.0 410 | margin/right = 0.0 411 | margin/bottom = 0.0 412 | custom_fonts/font = ExtResource( 4 ) 413 | custom_colors/font_color = Color( 0.773438, 0.773438, 0.773438, 1 ) 414 | text = "Return" 415 | align = 1 416 | valign = 1 417 | percent_visible = 1.0 418 | lines_skipped = 0 419 | max_lines_visible = -1 420 | 421 | [node name="btnSettings" type="TextureButton" parent="gui/menu_window"] 422 | 423 | anchor/left = 3 424 | anchor/top = 3 425 | anchor/right = 3 426 | anchor/bottom = 3 427 | focus/ignore_mouse = false 428 | focus/stop_mouse = true 429 | size_flags/horizontal = 2 430 | size_flags/vertical = 2 431 | margin/left = 93.0 432 | margin/top = 53.0 433 | margin/right = -93.0 434 | margin/bottom = 5.0 435 | disabled = true 436 | toggle_mode = false 437 | enabled_focus_mode = 2 438 | shortcut = null 439 | textures/normal = ExtResource( 15 ) 440 | textures/pressed = ExtResource( 16 ) 441 | textures/hover = ExtResource( 17 ) 442 | __meta__ = { "_editor_collapsed":true } 443 | 444 | [node name="txt" type="Label" parent="gui/menu_window/btnSettings"] 445 | 446 | anchor/right = 1 447 | anchor/bottom = 1 448 | focus/ignore_mouse = true 449 | focus/stop_mouse = true 450 | size_flags/horizontal = 2 451 | size_flags/vertical = 0 452 | margin/left = 0.0 453 | margin/top = 0.0 454 | margin/right = 0.0 455 | margin/bottom = 0.0 456 | custom_fonts/font = ExtResource( 4 ) 457 | custom_colors/font_color = Color( 0.773438, 0.773438, 0.773438, 1 ) 458 | text = "Settings" 459 | align = 1 460 | valign = 1 461 | percent_visible = 1.0 462 | lines_skipped = 0 463 | max_lines_visible = -1 464 | 465 | [node name="btnSkill" type="TextureButton" parent="gui/menu_window"] 466 | 467 | anchor/left = 3 468 | anchor/top = 3 469 | anchor/right = 3 470 | anchor/bottom = 3 471 | focus/ignore_mouse = false 472 | focus/stop_mouse = true 473 | size_flags/horizontal = 2 474 | size_flags/vertical = 2 475 | margin/left = 93.0 476 | margin/top = -2.0 477 | margin/right = -93.0 478 | margin/bottom = -50.0 479 | toggle_mode = false 480 | enabled_focus_mode = 2 481 | shortcut = null 482 | textures/normal = ExtResource( 15 ) 483 | textures/pressed = ExtResource( 16 ) 484 | textures/hover = ExtResource( 17 ) 485 | __meta__ = { "_editor_collapsed":true } 486 | 487 | [node name="txt" type="Label" parent="gui/menu_window/btnSkill"] 488 | 489 | anchor/right = 1 490 | anchor/bottom = 1 491 | focus/ignore_mouse = true 492 | focus/stop_mouse = true 493 | size_flags/horizontal = 2 494 | size_flags/vertical = 0 495 | margin/left = 0.0 496 | margin/top = 0.0 497 | margin/right = 0.0 498 | margin/bottom = 0.0 499 | custom_fonts/font = ExtResource( 4 ) 500 | custom_colors/font_color = Color( 0.773438, 0.773438, 0.773438, 1 ) 501 | text = "Skills" 502 | align = 1 503 | valign = 1 504 | percent_visible = 1.0 505 | lines_skipped = 0 506 | max_lines_visible = -1 507 | 508 | [node name="btnQuit" type="TextureButton" parent="gui/menu_window"] 509 | 510 | anchor/left = 3 511 | anchor/top = 3 512 | anchor/right = 3 513 | anchor/bottom = 3 514 | focus/ignore_mouse = false 515 | focus/stop_mouse = true 516 | size_flags/horizontal = 2 517 | size_flags/vertical = 2 518 | margin/left = 93.0 519 | margin/top = -59.0 520 | margin/right = -93.0 521 | margin/bottom = -107.0 522 | toggle_mode = false 523 | enabled_focus_mode = 2 524 | shortcut = null 525 | textures/normal = ExtResource( 15 ) 526 | textures/pressed = ExtResource( 16 ) 527 | textures/hover = ExtResource( 17 ) 528 | __meta__ = { "_editor_collapsed":true } 529 | 530 | [node name="txt" type="Label" parent="gui/menu_window/btnQuit"] 531 | 532 | anchor/right = 1 533 | anchor/bottom = 1 534 | focus/ignore_mouse = true 535 | focus/stop_mouse = true 536 | size_flags/horizontal = 2 537 | size_flags/vertical = 0 538 | margin/left = 0.0 539 | margin/top = 0.0 540 | margin/right = 0.0 541 | margin/bottom = 0.0 542 | custom_fonts/font = ExtResource( 4 ) 543 | custom_colors/font_color = Color( 0.773438, 0.773438, 0.773438, 1 ) 544 | text = "Quit Game" 545 | align = 1 546 | valign = 1 547 | percent_visible = 1.0 548 | lines_skipped = 0 549 | max_lines_visible = -1 550 | 551 | [node name="fps_counter" type="Label" parent="gui"] 552 | 553 | focus/ignore_mouse = true 554 | focus/stop_mouse = true 555 | size_flags/horizontal = 2 556 | size_flags/vertical = 0 557 | margin/left = 0.0 558 | margin/top = 0.0 559 | margin/right = 40.0 560 | margin/bottom = 16.0 561 | custom_colors/font_color = Color( 1, 1, 1, 1 ) 562 | custom_colors/font_color_shadow = Color( 0, 0, 0, 1 ) 563 | percent_visible = 1.0 564 | lines_skipped = 0 565 | max_lines_visible = -1 566 | script/script = SubResource( 5 ) 567 | 568 | [node name="env" type="Spatial" parent="."] 569 | 570 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 571 | 572 | [node name="levels" type="Spatial" parent="env"] 573 | 574 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 575 | script/script = ExtResource( 18 ) 576 | 577 | [node name="ambience" type="StreamPlayer" parent="."] 578 | 579 | stream/stream = ExtResource( 19 ) 580 | stream/play = false 581 | stream/loop = true 582 | stream/volume_db = 0.0 583 | stream/autoplay = true 584 | stream/paused = false 585 | stream/loop_restart_time = 0.0 586 | stream/buffering_ms = 500 587 | 588 | 589 | -------------------------------------------------------------------------------- /sprites/src/gui.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 38 | 40 | 43 | 47 | 51 | 52 | 61 | 64 | 70 | 71 | 72 | 74 | 75 | 77 | image/svg+xml 78 | 80 | 81 | 82 | 83 | 84 | 88 | 97 | 106 | 115 | 118 | 125 | 132 | 139 | 140 | 144 | 148 | 153 | 154 | 164 | 174 | LV 188 | 198 | 208 | 214 | 222 | 230 | 231 | 233 | 240 | 247 | 252 | 260 | 266 | 269 | 276 | 283 | 284 | 285 | 286 | 296 | 301 | 307 | 312 | 313 | 319 | 327 | 333 | 336 | 343 | 350 | 351 | 352 | 356 | 366 | 376 | 386 | 387 | 392 | 402 | 412 | 422 | 432 | 433 | 438 | 448 | 458 | 468 | 469 | 473 | 483 | 493 | 503 | 504 | 508 | 518 | 528 | 538 | 539 | 549 | 559 | 569 | 579 | 589 | 594 | 600 | 605 | 610 | 615 | 620 | 621 | 622 | 623 | --------------------------------------------------------------------------------