[032] Prototype Framework

[18h] Managable Systems using C# Interface Logic

[May 14] 5h - Planning the Functions
[May 15] 4h - 5 Functions
[May 16] 2h - Player and Enemies
[May 17] 3h - Damage and Bullets
[May 18] 3h - Callables and Target
[May 20] 1h - Upload

# func alive() -> void:        # initial load if has save
# func start() -> void:        # start / unpause
# func pause() -> void:        # pause
# func reset() -> void:        # reset / initial load if no save
# func death() -> void:        # gameover

# parent scripts = max Readabilty & Modularity
# child scripts  = max Optimization


# use of set for child variables
    var target: Vector2:
        set(val): Slime.target = val


# use of get for child variables
    var near_position: Vector2:
        get: return _slime_array[_near_index].position


# use of get for functions
    var positions: Array[Vector2]:
        get = _get_positions

    func _get_positions() -> Array[Vector2]:
        var active_positions: Array[Vector2]

        for index in _slime_array.size():
            if _slime_alive[index] == true:
                active_positions.append(_slime_array[index].global_position)

        return active_positions


# use of Signals to trigger parent functions
# use of Callable to capture parent data
    var on_fire: Callable                            # Array[Vector2] = [position, target]

    fire(on_fire.call() as Array[Vector2])           # currently not type safe

    func fire(_data: Array[Vector2]) -> void:

    _bullets.on_fire = Callable(func() -> Array[Vector2]: return [_player.position, _aim.position])
StatusReleased
PlatformsHTML5
AuthorQuietGodot
Made withGodot

Leave a comment

Log in with itch.io to leave a comment.