Compare commits

..

No commits in common. "main" and "CompoSubmission" have entirely different histories.

20 changed files with 95 additions and 1094 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -1,268 +0,0 @@
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' lang='' xml:lang=''>
<head>
<meta charset='utf-8' />
<meta name='viewport' content='width=device-width, user-scalable=no' />
<link id='-gd-engine-icon' rel='icon' type='image/png' href='favicon.png' />
<title>Gravity Limbo</title>
<style type='text/css'>
body {
touch-action: none;
margin: 0;
border: 0 none;
padding: 0;
text-align: center;
background-color: black;
}
#canvas {
display: block;
margin: 0;
color: white;
}
#canvas:focus {
outline: none;
}
.godot {
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
color: #e0e0e0;
background-color: #3b3943;
background-image: linear-gradient(to bottom, #403e48, #35333c);
border: 1px solid #45434e;
box-shadow: 0 0 1px 1px #2f2d35;
}
/* Status display
* ============== */
#status {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
/* don't consume click events - make children visible explicitly */
visibility: hidden;
}
#status-progress {
width: 366px;
height: 7px;
background-color: #38363A;
border: 1px solid #444246;
padding: 1px;
box-shadow: 0 0 2px 1px #1B1C22;
border-radius: 2px;
visibility: visible;
}
@media only screen and (orientation:portrait) {
#status-progress {
width: 61.8%;
}
}
#status-progress-inner {
height: 100%;
width: 0;
box-sizing: border-box;
transition: width 0.5s linear;
background-color: #202020;
border: 1px solid #222223;
box-shadow: 0 0 1px 1px #27282E;
border-radius: 3px;
}
#status-indeterminate {
visibility: visible;
position: relative;
}
#status-indeterminate > div {
width: 4.5px;
height: 0;
border-style: solid;
border-width: 9px 3px 0 3px;
border-color: #2b2b2b transparent transparent transparent;
transform-origin: center 21px;
position: absolute;
}
#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }
#status-notice {
margin: 0 100px;
line-height: 1.3;
visibility: visible;
padding: 4px 6px;
visibility: visible;
}
</style>
</head>
<body>
<canvas id='canvas'>
HTML5 canvas appears to be unsupported in the current browser.<br />
Please try updating or use a different browser.
</canvas>
<div id='status'>
<div id='status-progress' style='display: none;' oncontextmenu='event.preventDefault();'><div id ='status-progress-inner'></div></div>
<div id='status-indeterminate' style='display: none;' oncontextmenu='event.preventDefault();'>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div id='status-notice' class='godot' style='display: none;'></div>
</div>
<script type='text/javascript' src='ld48-gravity_limbo.js'></script>
<script type='text/javascript'>//<![CDATA[
var engine = new Engine;
var setStatusMode;
var setStatusNotice;
(function() {
const EXECUTABLE_NAME = 'ld48-gravity_limbo';
const MAIN_PACK = 'ld48-gravity_limbo.pck';
const INDETERMINATE_STATUS_STEP_MS = 100;
var canvas = document.getElementById('canvas');
var statusProgress = document.getElementById('status-progress');
var statusProgressInner = document.getElementById('status-progress-inner');
var statusIndeterminate = document.getElementById('status-indeterminate');
var statusNotice = document.getElementById('status-notice');
var initializing = true;
var statusMode = 'hidden';
var animationCallbacks = [];
function animate(time) {
animationCallbacks.forEach(callback => callback(time));
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
function adjustCanvasDimensions() {
var scale = window.devicePixelRatio || 1;
var width = window.innerWidth;
var height = window.innerHeight;
canvas.width = width * scale;
canvas.height = height * scale;
canvas.style.width = width + "px";
canvas.style.height = height + "px";
}
animationCallbacks.push(adjustCanvasDimensions);
adjustCanvasDimensions();
setStatusMode = function setStatusMode(mode) {
if (statusMode === mode || !initializing)
return;
[statusProgress, statusIndeterminate, statusNotice].forEach(elem => {
elem.style.display = 'none';
});
animationCallbacks = animationCallbacks.filter(function(value) {
return (value != animateStatusIndeterminate);
});
switch (mode) {
case 'progress':
statusProgress.style.display = 'block';
break;
case 'indeterminate':
statusIndeterminate.style.display = 'block';
animationCallbacks.push(animateStatusIndeterminate);
break;
case 'notice':
statusNotice.style.display = 'block';
break;
case 'hidden':
break;
default:
throw new Error('Invalid status mode');
}
statusMode = mode;
}
function animateStatusIndeterminate(ms) {
var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8);
if (statusIndeterminate.children[i].style.borderTopColor == '') {
Array.prototype.slice.call(statusIndeterminate.children).forEach(child => {
child.style.borderTopColor = '';
});
statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf';
}
}
setStatusNotice = function setStatusNotice(text) {
while (statusNotice.lastChild) {
statusNotice.removeChild(statusNotice.lastChild);
}
var lines = text.split('\n');
lines.forEach((line) => {
statusNotice.appendChild(document.createTextNode(line));
statusNotice.appendChild(document.createElement('br'));
});
};
engine.setProgressFunc((current, total) => {
if (total > 0) {
statusProgressInner.style.width = current/total * 100 + '%';
setStatusMode('progress');
if (current === total) {
// wait for progress bar animation
setTimeout(() => {
setStatusMode('indeterminate');
}, 500);
}
} else {
setStatusMode('indeterminate');
}
});
function displayFailureNotice(err) {
var msg = err.message || err;
console.error(msg);
setStatusNotice(msg);
setStatusMode('notice');
initializing = false;
};
if (!Engine.isWebGLAvailable()) {
displayFailureNotice('WebGL not available');
} else {
setStatusMode('indeterminate');
engine.setCanvas(canvas);
engine.startGame(EXECUTABLE_NAME, MAIN_PACK).then(() => {
setStatusMode('hidden');
initializing = false;
}, displayFailureNotice);
}
})();
//]]></script>
</body>
</html>

View File

@ -1,268 +0,0 @@
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' lang='' xml:lang=''>
<head>
<meta charset='utf-8' />
<meta name='viewport' content='width=device-width, user-scalable=no' />
<link id='-gd-engine-icon' rel='icon' type='image/png' href='favicon.png' />
<title>Gravity Limbo</title>
<style type='text/css'>
body {
touch-action: none;
margin: 0;
border: 0 none;
padding: 0;
text-align: center;
background-color: black;
}
#canvas {
display: block;
margin: 0;
color: white;
}
#canvas:focus {
outline: none;
}
.godot {
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
color: #e0e0e0;
background-color: #3b3943;
background-image: linear-gradient(to bottom, #403e48, #35333c);
border: 1px solid #45434e;
box-shadow: 0 0 1px 1px #2f2d35;
}
/* Status display
* ============== */
#status {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
/* don't consume click events - make children visible explicitly */
visibility: hidden;
}
#status-progress {
width: 366px;
height: 7px;
background-color: #38363A;
border: 1px solid #444246;
padding: 1px;
box-shadow: 0 0 2px 1px #1B1C22;
border-radius: 2px;
visibility: visible;
}
@media only screen and (orientation:portrait) {
#status-progress {
width: 61.8%;
}
}
#status-progress-inner {
height: 100%;
width: 0;
box-sizing: border-box;
transition: width 0.5s linear;
background-color: #202020;
border: 1px solid #222223;
box-shadow: 0 0 1px 1px #27282E;
border-radius: 3px;
}
#status-indeterminate {
visibility: visible;
position: relative;
}
#status-indeterminate > div {
width: 4.5px;
height: 0;
border-style: solid;
border-width: 9px 3px 0 3px;
border-color: #2b2b2b transparent transparent transparent;
transform-origin: center 21px;
position: absolute;
}
#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }
#status-notice {
margin: 0 100px;
line-height: 1.3;
visibility: visible;
padding: 4px 6px;
visibility: visible;
}
</style>
</head>
<body>
<canvas id='canvas'>
HTML5 canvas appears to be unsupported in the current browser.<br />
Please try updating or use a different browser.
</canvas>
<div id='status'>
<div id='status-progress' style='display: none;' oncontextmenu='event.preventDefault();'><div id ='status-progress-inner'></div></div>
<div id='status-indeterminate' style='display: none;' oncontextmenu='event.preventDefault();'>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div id='status-notice' class='godot' style='display: none;'></div>
</div>
<script type='text/javascript' src='ld48-gravity_limbo.js'></script>
<script type='text/javascript'>//<![CDATA[
var engine = new Engine;
var setStatusMode;
var setStatusNotice;
(function() {
const EXECUTABLE_NAME = 'ld48-gravity_limbo';
const MAIN_PACK = 'ld48-gravity_limbo.pck';
const INDETERMINATE_STATUS_STEP_MS = 100;
var canvas = document.getElementById('canvas');
var statusProgress = document.getElementById('status-progress');
var statusProgressInner = document.getElementById('status-progress-inner');
var statusIndeterminate = document.getElementById('status-indeterminate');
var statusNotice = document.getElementById('status-notice');
var initializing = true;
var statusMode = 'hidden';
var animationCallbacks = [];
function animate(time) {
animationCallbacks.forEach(callback => callback(time));
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
function adjustCanvasDimensions() {
var scale = window.devicePixelRatio || 1;
var width = window.innerWidth;
var height = window.innerHeight;
canvas.width = width * scale;
canvas.height = height * scale;
canvas.style.width = width + "px";
canvas.style.height = height + "px";
}
animationCallbacks.push(adjustCanvasDimensions);
adjustCanvasDimensions();
setStatusMode = function setStatusMode(mode) {
if (statusMode === mode || !initializing)
return;
[statusProgress, statusIndeterminate, statusNotice].forEach(elem => {
elem.style.display = 'none';
});
animationCallbacks = animationCallbacks.filter(function(value) {
return (value != animateStatusIndeterminate);
});
switch (mode) {
case 'progress':
statusProgress.style.display = 'block';
break;
case 'indeterminate':
statusIndeterminate.style.display = 'block';
animationCallbacks.push(animateStatusIndeterminate);
break;
case 'notice':
statusNotice.style.display = 'block';
break;
case 'hidden':
break;
default:
throw new Error('Invalid status mode');
}
statusMode = mode;
}
function animateStatusIndeterminate(ms) {
var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8);
if (statusIndeterminate.children[i].style.borderTopColor == '') {
Array.prototype.slice.call(statusIndeterminate.children).forEach(child => {
child.style.borderTopColor = '';
});
statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf';
}
}
setStatusNotice = function setStatusNotice(text) {
while (statusNotice.lastChild) {
statusNotice.removeChild(statusNotice.lastChild);
}
var lines = text.split('\n');
lines.forEach((line) => {
statusNotice.appendChild(document.createTextNode(line));
statusNotice.appendChild(document.createElement('br'));
});
};
engine.setProgressFunc((current, total) => {
if (total > 0) {
statusProgressInner.style.width = current/total * 100 + '%';
setStatusMode('progress');
if (current === total) {
// wait for progress bar animation
setTimeout(() => {
setStatusMode('indeterminate');
}, 500);
}
} else {
setStatusMode('indeterminate');
}
});
function displayFailureNotice(err) {
var msg = err.message || err;
console.error(msg);
setStatusNotice(msg);
setStatusMode('notice');
initializing = false;
};
if (!Engine.isWebGLAvailable()) {
displayFailureNotice('WebGL not available');
} else {
setStatusMode('indeterminate');
engine.setCanvas(canvas);
engine.startGame(EXECUTABLE_NAME, MAIN_PACK).then(() => {
setStatusMode('hidden');
initializing = false;
}, displayFailureNotice);
}
})();
//]]></script>
</body>
</html>

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -7,7 +7,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="build/html/ld48-gravity_limbo.html"
export_path="build/ld48-gravity_limbo.html"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

View File

@ -566,7 +566,7 @@ func goto_scene(scene, current = null, free = true):
call_deferred("_deferred_goto_scene", scene, current, free)
func _deferred_goto_scene(scene, current = null, free = true):
#get_tree().get_root().print_tree_pretty()
get_tree().get_root().print_tree_pretty()
if current:
if free:
current.free()

View File

@ -48,7 +48,7 @@ func _on_choice_made(index):
var result_indices = self.data["choices"][index]["results"].keys()
var result = null
var chance = GameState.rng.randi_range(0, 100)
#print(chance)
print(chance)
var i = len(result_indices) - 1
while i >= 0:
if chance >= result_indices[i]:
@ -56,7 +56,7 @@ func _on_choice_made(index):
break
else:
i -= 1
#print(result)
print(result)
#print(self.data["choices"][index]["results"][result])
var action = self.data["choices"][index]["results"][result]
if action.has("stat_changes"):
@ -65,23 +65,24 @@ func _on_choice_made(index):
GameState.update_orbit(action["orbit_changes"])
if action.has("crew_changes"):
GameState.update_crew(action["crew_changes"])
#print(action)
print(action)
var t = RichTextLabel.new()
t.set_use_bbcode(true)
var text = self.data["choices"][index]["then"]
if action.has("text"):
text += "\n\n" + action['text']
if action.has("stat_changes") and action["stat_changes"]:
print("yes")
text += "\n\n[center]Effects:[/center]\n"
for k in action["stat_changes"].keys():
#print(k)
print(k)
var value = action["stat_changes"][k]
var color = "green"
if value < 0:
color = "red"
#print(color)
print(color)
var addition = k + ": [color=" + color + "]" + str(value) + "[/color]\n"
#print(addition)
print(addition)
text += addition
t.set_bbcode(text)
t.set_fit_content_height(true)

View File

@ -9,44 +9,33 @@ signal encounter_choice_changed
var choices = 3
var level = 0
var buttonNames = [
"Option0",
"Option1",
"Option2",
]
# Called when the node enters the scene tree for the first time.
func _ready():
# Bind button callbacks
#for n in buttonNames:
# var button = self.find_node(n)
# if button:
# button.connect("toggled", self, "_on_option_button_pressed", [n])
pass
for n in buttonNames:
var button = self.find_node(n)
if button:
button.connect("toggled", self, "_on_option_button_pressed", [n])
func initialize(l = null, nOptions = null):
self.level = l
print("Intializing choices for level " + str(l) + " with " + str(nOptions) + " options")
if nOptions == null:
nOptions = 3
self.choices = nOptions
var x = 0
while x < nOptions:
var s = get_node("Spot" + str(x))
var n = TextureButton.new()
if s:
n.set_position(s.get_position())
n.set_name("Option" + str(x))
n.add_to_group("EncounterOptions")
n.set_toggle_mode(true)
#print("Adding option with name: " + n.get_name())
n.connect("toggled", self, "_on_option_button_pressed", [n.get_name()])
n.set_normal_texture(ResourceLoader.load("res://assets/encounterPlaceholder0.png"))
n.set_pressed_texture(ResourceLoader.load("res://assets/encounterIconPlaceholder0_pressed.png"))
add_child(n, true)
print("Adding texture button: Option" + str(x))
#self.find_node("Option" + str(x)).visible = x < nOptions
x += 1
if nOptions != null:
self.choices = nOptions
var x = 0
while x < 3:
self.find_node("Option" + str(x)).visible = x < nOptions
x += 1
func activate_options():
for c in get_my_options():
if c.visible:
c.set_disabled(false)
if self.choices > 1:
for c in self.get_children():
if c.visible:
c.set_disabled(false)
func active_visited():
var i = self.get_active_option_index()
@ -60,28 +49,19 @@ func active_visited():
return GameState.encounters[self.level][i]['visited']
func disable_options():
for c in get_my_options():
for c in self.get_children():
if c.visible:
c.set_disabled(true)
func get_active_option_index():
var x = 0
print("Checking for active index of level " + str(level))
for c in get_my_options():
var i = int(c.get_name()[-1])
if GameState.encounters[self.level][i]['visited']:
print(c.get_name() + " is visited, skipping")
x += 1
continue
for c in self.get_children():
if not c.is_visible():
print(c.get_name() + " is not visible, skipping")
x += 1
continue
if c.is_pressed() or GameState.encounters[self.level][i]['selected']:
print(c.get_name() + " is pressed")
if c.is_pressed():
return x
else:
print(c.get_name() + " is not pressed, skipping")
x += 1
return null
@ -97,28 +77,16 @@ func get_active_position():
func has_active():
var active = false
for n in get_my_options():
active = active or (n.is_pressed() and n.is_visible())
for n in buttonNames:
if get_node(n):
active = active or (self.get_node(n).is_pressed() and self.get_node(n).is_visible())
return active
func get_my_options():
var n = []
if not get_tree():
return n
for o in get_tree().get_nodes_in_group("EncounterOptions"):
if o.get_parent() != self:
continue
n.append(o)
return n
func _on_option_button_pressed(state, buttonName):
# Map calls this before we have buttons. Or before we exist?
#print(buttonName + " has state: " + str(state))
for n in get_my_options():
#print(n.get_name())
if n.get_name() != buttonName:
if state :
n.set_pressed(false)
for n in buttonNames:
if n != buttonName:
if state and get_node(n):
self.get_node(n).set_pressed(false)
emit_signal("encounter_choice_changed")
#for n in buttonNames:
# if self.find_node(n).is_pressed():

View File

@ -1,16 +1,52 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://src/ui/EncounterChoice.gd" type="Script" id=1]
[ext_resource path="res://assets/encounterPlaceholder2.png" type="Texture" id=2]
[ext_resource path="res://assets/encounterPlaceholder0.png" type="Texture" id=3]
[ext_resource path="res://assets/encounterPlaceholder1.png" type="Texture" id=4]
[ext_resource path="res://assets/encounterIconPlaceholder0_pressed.png" type="Texture" id=5]
[ext_resource path="res://assets/encounterIconPlaceholder1_pressed.png" type="Texture" id=6]
[ext_resource path="res://assets/encounterIconPlaceholder2_pressed.png" type="Texture" id=7]
[node name="EncounterChoice" type="Node2D"]
position = Vector2( -0.5, 0.5 )
script = ExtResource( 1 )
[node name="Spot0" type="Node2D" parent="."]
position = Vector2( 37.0812, -38.6704 )
[node name="Option0" type="TextureButton" parent="."]
margin_left = -28.8286
margin_top = 14.3104
margin_right = 11.1714
margin_bottom = 54.3104
hint_tooltip = "Option 0"
toggle_mode = true
texture_normal = ExtResource( 3 )
texture_pressed = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Spot1" type="Node2D" parent="."]
position = Vector2( 31.7839, 10.5946 )
[node name="Option1" type="TextureButton" parent="."]
margin_left = 24.2782
margin_top = 16.5904
margin_right = 64.2782
margin_bottom = 56.5904
hint_tooltip = "Option 1"
toggle_mode = true
texture_normal = ExtResource( 4 )
texture_pressed = ExtResource( 6 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Spot2" type="Node2D" parent="."]
position = Vector2( -15.3622, 38.1406 )
[node name="Option2" type="TextureButton" parent="."]
margin_left = 17.7514
margin_top = -36.9294
margin_right = 57.7514
margin_bottom = 3.07064
hint_tooltip = "Option 2"
toggle_mode = true
texture_normal = ExtResource( 2 )
texture_pressed = ExtResource( 7 )
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -30,17 +30,11 @@ func _on_ship_arrived():
#
if GameState.current_state != 5 and GameState.current_state != 8:
return
# Work around a duplicate event bug
if GameState.current_state == 8 and self.direction == 1:
return
var index = get_node("Map/Level" + str(GameState.current_depth)).get_active_option_index()
if index == null:
var n = get_node("Map/Level" + str(GameState.current_depth))
print(GameState.encounters[GameState.current_depth])
print("Got index for level " + str(GameState.current_depth) + ": " + str(index))
GameState.encounters[GameState.current_depth][index]['visited'] = true
get_node("Map").draw_course()
var e = GameState.encounters[GameState.current_depth]
print(e[index])
var instance = GameState.generate_encounter_instance(e, GameState.current_depth, index)
instance.add_to_group("Encounters")
self.add_child(instance)

View File

@ -22,7 +22,7 @@ func _ready():
self.get_node("Planet").set_texture(ResourceLoader.load(GameState.get_difficulty_data("planet")))
var encounterChoice = ResourceLoader.load("res://src/ui/EncounterChoice.tscn")
for level in GameState.encounters.keys():
#print(level)
print(level)
var name = "Level" + str(level)
var choice = encounterChoice.instance()
choice.set_name(name)
@ -33,15 +33,14 @@ func _ready():
var x = 0
while x < len(GameState.encounters[level]):
# Fixes the rotation of the individual buttons
var n = choice.get_node("Option" + str(x))
var n = choice.find_node("Option" + str(x))
if not n:
x += 1
continue
n.set_rotation(
-(find_node("Level" + str(level) + "Location").get_global_rotation())
)
# Set icon and tooltip
#print("Checking for icons related to '" + GameState.encounters[level][x]["type"] + "'")
print("Checking for icons related to '" + GameState.encounters[level][x]["type"] + "'")
var texture = ResourceLoader.load("res://assets/encounterIcon" + GameState.encounters[level][x]["type"] + ".png")
var texture_pressed = ResourceLoader.load("res://assets/encounterIcon" + GameState.encounters[level][x]["type"] + "_pressed.png")
if texture:
@ -53,7 +52,7 @@ func _ready():
if GameState.encounters[level][x]["selected"] or (x == 0 and started_ourselves):
# The texture change is used since when disabled the normal_texture is shown regardless of press state.
n.set_pressed(true)
#choice._on_option_button_pressed(true, "Option" + str(x))
choice._on_option_button_pressed(true, "Option" + str(x))
#n.set_normal_texture(n.get_pressed_texture())
if GameState.encounters[level][x]["visited"]:
n.set_visible(false)
@ -89,7 +88,7 @@ func _on_encounter_choice_changed():
func draw_course():
# A bit brutal
for p in get_tree().get_nodes_in_group("Course"):
#print(p.get_name())
print(p.get_name())
p.set_visible(false)
p.call_deferred("free")
@ -98,21 +97,18 @@ func draw_course():
while x < (len(GameState.encounters) - 1):
pairs.append([x, x+1])
x += 1
#print(pairs)
print(pairs)
for p in pairs:
var first = get_node("Level" + str(p[0]))
var second = get_node("Level" + str(p[1]))
if not first or not second:
#print("One is null: " + str(p))
print("One is null: " + str(p))
continue
#if not first.has_active() or not second.has_active():
# print("One has no active: " + str(p))
# continue
#if second.active_visited():
# print("Second has a visited active choice: " + str(p))
# continue
if not first.get_active_position() or not second.get_active_position():
#print("One has no posiion: " + str(p))
if not first.has_active() or not second.has_active():
print("One has no active: " + str(p))
continue
if second.active_visited():
print("Second has a visited active choice: " + str(p))
continue
var l = Line2D.new()
l.add_point(first.get_active_position())

View File

@ -42,7 +42,7 @@ rotation = 2.79253
scale = Vector2( 1.05, 1.05 )
[node name="Level5Location" type="Node2D" parent="."]
position = Vector2( 462.041, 252.234 )
position = Vector2( 506.488, 220.486 )
[node name="Ship" type="Sprite" parent="."]
position = Vector2( 1.5874, 3.96851 )