Skip to content

Commit

Permalink
Uploaded Skeleton Engine
Browse files Browse the repository at this point in the history
  • Loading branch information
JenniBee committed Apr 16, 2017
1 parent 9168484 commit a0e2f21
Show file tree
Hide file tree
Showing 67 changed files with 5,135 additions and 0 deletions.
66 changes: 66 additions & 0 deletions engine.cfg
@@ -0,0 +1,66 @@
[application]

main_scene="res://globals/scene_main.tscn"
save_data="res://globals/save_data.gd"
tooltip_lang_default="en"
speech_suffix=".spx"
max_voice_volume=2

[autoload]

main="res://main.scn"
vm="res://globals/global_vm.scn"

[debug]

print_clicked_control=true

[display]

test_width=1280
test_height=720
width=1920
height=1080
game_width=1920
game_height=1080

[input]

quick_save=[key(F4)]
start=[jbutton(0, 11)]
inventory_toggle=[jbutton(0, 5), jbutton(0, 7), jbutton(0, 9)]
look=[jbutton(0, 3)]
use=[jbutton(0, 2)]
talk=[jbutton(0, 1)]
punch_out_punch=[key(X), jbutton(0, 0)]
punch_out_dodge=[key(Z), jbutton(0, 2)]
menu_request=[key(Escape), jbutton(0, 11)]


[platform]

gamecenter=false
dialog_option_height=1
telon="res://globals/telon.scn"
hud_mobile=false
show_ingame_buttons=false
dialog_instance_scale=1
dialog_type_suffix=""
action_menu_scale=1
logos="res://game/logos.ogm"
use_custom_camera=false
file_cases="res://game/ui/file_cases/file_cases.scn"
ghost_remap=""
disable_screen_shaders=false
window_title_height=32
credits="res://game/ui/credits/credits.txt"
windowed_available=true
screen_resizable=true
exit_button=true

[ui]

main_menu="res://ui/main_menu.tscn"
in_game_menu=""
credits=""
savegames=""
9 changes: 9 additions & 0 deletions game/fallbacks.esc
@@ -0,0 +1,9 @@


:use
debug "use fallback!"
say player "I can't do that"

:pick_up
debug "pick_up fallback!"
say player "That's not a good idea"
3 changes: 3 additions & 0 deletions game/game.esc
@@ -0,0 +1,3 @@
:load

change_scene res://scenes/test/test.scn
Binary file added game/inventory_items.scn
Binary file not shown.
4 changes: 4 additions & 0 deletions game/scenes_cache.gd
@@ -0,0 +1,4 @@
const scenes = [
"res://globals/game.scn",
#"res://game/player/player.xml",
]
47 changes: 47 additions & 0 deletions globals/achievements.gd
@@ -0,0 +1,47 @@
var GameCenter = null
var iOS = null
var achieves_left = 2

func flush():
while GameCenter.get_pending_event_count() > 0:
GameCenter.pop_pending_event()

func award(aid):
if GameCenter == null:
return

flush()

printt("******** awarding achievement ", aid)
GameCenter.award_achievement( { "name": aid, "progress": 100, "show_completion_banner": true } )

var vm = OS.get_main_loop().get_root().get_node("/root/vm")
if vm.settings.rate_shown:
return

achieves_left -= 1
if achieves_left > 0:
return

printt("showing rate screen")
var url = iOS.get_rate_url(Globals.get("ios/app_id"))
vm.show_rate(url)

vm.settings.rate_shown = true
vm.save_settings()


func reset():
if GameCenter == null:
return

flush()
GameCenter.reset_achievements()

func is_ready():
return true

func start():
if Globals.has_singleton("GameCenter"):
GameCenter = Globals.get_singleton("GameCenter")
iOS = Globals.get_singleton("iOS")
50 changes: 50 additions & 0 deletions globals/action_menu.gd
@@ -0,0 +1,50 @@
var target
var actions

func action_pressed(action):
get_tree().call_group(0, "game", "action_menu_selected", target, action)

func target_visibility_changed():
stop()

func start(p_target):
#actions[0].grab_focus()

if target != p_target:
target = p_target
target.connect("visibility_changed", self, "target_visibility_changed")

var scale = Globals.get("platform/action_menu_scale")
set_scale(Vector2(scale, scale))

func stop():
if target != null:
target.disconnect("visibility_changed", self, "target_visibility_changed")
target = null
hide()

func _input(event):
if !is_visible():
return
if !get_node("/root/vm").can_interact():
return
if !event.is_pressed():
return

for a in actions:
if event.is_action(a.get_name()):
action_pressed(a.get_name())
break

func _ready():

actions = []
var acts = get_node("actions")
for i in range(acts.get_child_count()):
var c = acts.get_child(i)
if !c.is_type("Button"):
continue
actions.push_back(c)
c.connect("pressed", self, "action_pressed", [c.get_name()])

set_process_input(true)
23 changes: 23 additions & 0 deletions globals/background.gd
@@ -0,0 +1,23 @@
extends Control

export var action = "walk"

func input(event):
if event.type == InputEvent.MOUSE_BUTTON && event.pressed:
if (event.button_index == 1):
get_tree().call_group(0, "game", "clicked", self, get_pos() + Vector2(event.x, event.y))
elif (event.button_index == 2):
emit_right_click()

func get_action():
return action

func _init():
add_user_signal("right_click_on_bg")

func _ready():
connect("input_event", self, "input")
add_to_group("background")

func emit_right_click():
emit_signal("right_click_on_bg")
35 changes: 35 additions & 0 deletions globals/bg_music.gd
@@ -0,0 +1,35 @@
extends "res://globals/item.gd"

var stream
var current_music

func game_cleared():
set_state("off", true)
if global_id != "":
vm.register_object(global_id, self)

func set_state(p_state, p_force = false):

if p_state == state && !p_force && stream.is_playing():
return

.set_state(p_state, p_force)

if stream == null:
return

if state == "off" || state == "default":
stream.set_stream(null)
return

var res = load(p_state)
stream.set_stream(res)
if res != null:
stream.set_loop(true)
stream.play()
stream.set_volume(vm.settings.music_volume)



func _ready():
stream = get_node("stream")
35 changes: 35 additions & 0 deletions globals/bg_music.tscn
@@ -0,0 +1,35 @@
[gd_scene load_steps=2 format=1]

[ext_resource path="res://globals/bg_music.gd" type="Script" id=1]

[node name="bg_music" type="Control"]

focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 40.0
margin/bottom = 40.0
script/script = ExtResource( 1 )
animations = null
speed = 300
scale_on_map = false
light_on_map = false
tooltip = ""
action = ""
events_path = ""
global_id = "bg_music"
use_combine = false
inventory = false
use_action_menu = true
interact_angle = -1
talk_animation = "talk"
active = true
placeholders = {

}
use_custom_z = false


19 changes: 19 additions & 0 deletions globals/dd_player.gd
@@ -0,0 +1,19 @@
func start(params, level):
var type
if params.size() < 2 || !has_resource(params[1]):
type = "default"
else:
type = params[1]

type = type + Globals.get("platform/dialog_type_suffix")

printt("******* instancing dialog ", type)

var inst = get_resource(type).instance()
get_parent().add_child(inst)

# check the type and instance it here?
inst.call_deferred("start", params, level)

func _ready():
add_to_group("dialog_dialog")
Binary file added globals/dd_player.scn
Binary file not shown.

0 comments on commit a0e2f21

Please sign in to comment.