godot/demos/2d/space_shooter/game_state.gd
Juan Linietsky 2b64f73b04 more code completion improvements
-calltip dissapears with more types of keypresses or when pressing ')'
-properly looks into autoloaded scripts or nodes with another script for
script functions/variables/etc.
2015-06-27 15:52:39 -03:00

24 lines
355 B
GDScript

extends Node
var points = 0
var max_points = 0
func _ready():
var f = File.new()
#load high score
if (f.open("user://highscore",File.READ)==OK):
max_points=f.get_var()
func game_over():
if (points>max_points):
max_points=points
#save high score
var f = File.new()
f.open("user://highscore",File.WRITE)
f.store_var(max_points)