This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if FIRE and can_fire: | |
var bullet = laser_bullet.instance() | |
var pos = get_pos() | |
pos.x -= 2*facing | |
bullet.set_pos(pos) | |
get_node('/root/globals').CURRENT_STAGE.add_child(bullet) | |
PS2D.body_add_collision_exception(bullet.get_rid(),get_rid()) | |
var y = rand_range(-BULLET_SPREAD, BULLET_SPREAD) | |
bullet.set_linear_velocity( Vector2(-facing*BULLET_SPEED,y) ) | |
can_fire=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Control | |
var game | |
var current_event = 0 | |
var event_object = {-1: null} | |
# EVENT SENSORS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends RigidBody2D | |
var SPD = 128.0 | |
var mstate = 'Idle' | |
var direction = 'up' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends RigidBody2D | |
var player_class = preload('res://scripts/player.gd') | |
var sploder = preload('res://scenes/laser_splode.xml') | |
func _on_VisibilityNotifier2D_exit_screen(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Control | |
var is_sliding = false | |
var down = false | |
var up_pos #defined in _ready() | |
var down_pos = 0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var saveGame = File.new() | |
#Legacy: Check for old savegame.sav in user:// | |
if saveGame.file_exists('user://savegame.sav'): | |
save_game(true) | |
print("Old savegame.sav found! Converting..") | |
if saveGame.file_exists('res://saves/savegame.sav'): | |
var usr = Directory.new() | |
var dir = usr.open('user://') | |
if dir == 0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func load_game(): | |
#Load the currently-saved game state | |
#Only one save slot for now. | |
var saveGame = File.new() | |
#Legacy: Check for old savegame.sav in user:// | |
if saveGame.file_exists('user://savegame.sav'): | |
save_game(true) | |
print("Old savegame.sav found! Converting..") | |
if saveGame.file_exists('res://saves/savegame.sav'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var saveGame = File.new() | |
#Legacy: Check for old savegame.sav in user:// | |
if saveGame.file_exists('user://savegame.sav'): | |
save_game(true) | |
print("Old savegame.sav found! Converting..") | |
if saveGame.file_exists('res://saves/savegame.sav'): | |
saveGame.remove('user://savegame.sav') ###??? | |
print("Deleted old save") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func _set_current_workforce(): | |
if workforce['current'] > workforce['max']: #Handle worker overflow bug | |
for w in workers: | |
w = 0 | |
_set_current_workforce() | |
news.message("[b]Your workers went on strike! Whip those bots back into shape, son![/b]") | |
_refresh() | |
else: | |
var total = workers[0]+workers[1]+workers[2]+workers[3] |
NewerOlder