Commit of existing data.
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
@tool
|
||||
class_name Config
|
||||
extends Resource
|
||||
|
||||
|
||||
@export var music_volume: float = 0
|
||||
@export var sfx_volume: float = 0
|
||||
@export var fullscreen: bool = false
|
||||
@export var vsync: bool = true
|
||||
|
||||
|
||||
func save() -> Error:
|
||||
return ResourceSaver.save(self, "user://config.tres")
|
||||
|
||||
|
||||
static func exists() -> bool:
|
||||
return ResourceLoader.exists("user://config.tres")
|
||||
|
||||
|
||||
static func load() -> Save:
|
||||
if exists():
|
||||
var config_data = ResourceLoader.load("user://config.tres")
|
||||
if config_data is Config:
|
||||
return config_data
|
||||
return null
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
uid://g5y7ghm6kw72
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
extends AnimatedSprite2D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
pass
|
||||
|
||||
|
||||
func _on_animation_finished():
|
||||
queue_free()
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
uid://dgo1wtjored0j
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
@tool
|
||||
class_name Save
|
||||
extends Resource
|
||||
|
||||
|
||||
enum Difficulty {EASY, NORMAL, HARD}
|
||||
enum Projectile {BLAST, FIRE, ICE, LASER}
|
||||
|
||||
|
||||
@export var slot: int = 1
|
||||
@export var playtime: int = 0
|
||||
@export var difficulty: Difficulty = Difficulty.NORMAL
|
||||
@export var max_health: int = 100
|
||||
@export var xp: int = 0
|
||||
@export var room: String = "labs"
|
||||
|
||||
@export var atk: int = 1
|
||||
@export var def: int = 1
|
||||
@export var con: int = 1
|
||||
@export var chg: int = 1
|
||||
|
||||
@export var projectile: Projectile = Projectile.BLAST;
|
||||
|
||||
@export var fire: bool = false
|
||||
@export var ice: bool = false
|
||||
@export var laser: bool = false
|
||||
@export var roll: bool = false
|
||||
@export var wall: bool = false
|
||||
@export var pound: bool = false
|
||||
@export var slice: bool = false
|
||||
|
||||
@export var lock_1: bool = false
|
||||
@export var lock_2: bool = false
|
||||
@export var lock_3: bool = false
|
||||
|
||||
|
||||
func _init(save_slot: int):
|
||||
self.slot = save_slot
|
||||
|
||||
|
||||
func save_to_disk() -> Error:
|
||||
return ResourceSaver.save(self, "user://slot_%s.res" % self.slot)
|
||||
|
||||
|
||||
static func exists(save_slot: int) -> bool:
|
||||
return ResourceLoader.exists("user://slot_%s.res" % save_slot)
|
||||
|
||||
|
||||
static func load(save_slot: int) -> Save:
|
||||
if exists(save_slot):
|
||||
var save_data = ResourceLoader.load("user://slot_%s.res" % save_slot)
|
||||
if save_data is Save:
|
||||
return save_data
|
||||
return null
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
uid://wq33hdwdp3up
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
class_name CollisionState2D
|
||||
extends CollisionShape2D
|
||||
|
||||
@export var Shapes: Dictionary[String, Shape2D]
|
||||
|
||||
func change_shape(id: String) -> void:
|
||||
if id in Shapes:
|
||||
shape = Shapes[id]
|
||||
elif len(Shapes) > 0:
|
||||
shape = Shapes[Shapes.keys()[0]]
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
uid://e6q7q0ljb34u
|
||||
Executable
+79
@@ -0,0 +1,79 @@
|
||||
class_name Timespan
|
||||
extends Node
|
||||
|
||||
var _millis: int
|
||||
|
||||
var _MillisPerSecond = 1000
|
||||
var _MillisPerMinute = _MillisPerSecond * 60
|
||||
var _MillisPerHour = _MillisPerMinute * 60
|
||||
var _MillisPerDay = _MillisPerHour * 24
|
||||
|
||||
|
||||
func _init(millis: int):
|
||||
_millis = millis
|
||||
|
||||
|
||||
func Add(ts: Timespan) -> Timespan:
|
||||
return Timespan.new(self._millis + ts._millis)
|
||||
|
||||
|
||||
func Subtract(ts: Timespan) -> Timespan:
|
||||
assert(self._millis >= ts._millis)
|
||||
return Timespan.new(self._millis - ts._millis)
|
||||
|
||||
|
||||
func CompareTo(ts: Timespan) -> int:
|
||||
if self._millis > ts._millis: return 1
|
||||
if self._millis < ts._millis: return -1
|
||||
return 0
|
||||
|
||||
|
||||
func Days() -> int:
|
||||
return _millis / _MillisPerDay
|
||||
|
||||
|
||||
func Hours() -> int:
|
||||
return (_millis / _MillisPerHour) % 24
|
||||
|
||||
|
||||
func Minutes() -> int:
|
||||
return (_millis / _MillisPerMinute) % 60
|
||||
|
||||
|
||||
func Seconds() -> int:
|
||||
return (_millis / _MillisPerSecond) % 60
|
||||
|
||||
|
||||
func Millis() -> int:
|
||||
return _millis % 1000
|
||||
|
||||
|
||||
func TotalDays() -> float:
|
||||
return float(_millis) / _MillisPerDay
|
||||
|
||||
|
||||
func TotalHours() -> float:
|
||||
return float(_millis) / _MillisPerHour
|
||||
|
||||
|
||||
func TotalMinutes() -> float:
|
||||
return float(_millis) / _MillisPerMinute
|
||||
|
||||
|
||||
func TotalSeconds() -> float:
|
||||
return float(_millis) / _MillisPerSecond
|
||||
|
||||
|
||||
func TotalMillis() -> int:
|
||||
return _millis
|
||||
|
||||
|
||||
static func FromTimestamps(t1: int, t2: int) -> Timespan:
|
||||
assert(t1 <= t2)
|
||||
return Timespan.new(t2 - t1)
|
||||
|
||||
|
||||
static func Compare(ts1: Timespan, ts2: Timespan) -> int:
|
||||
if ts1._millis > ts2._millis: return 1
|
||||
if ts1._millis < ts2._millis: return -1
|
||||
return 0
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
uid://dj2fhcdaja6h5
|
||||
Reference in New Issue
Block a user