itch.io is community of indie game creators and players

Devlogs

The 1.2 Global Database Update

All Projectiles
A browser Asset Demo made in HTML5

🚨Extremely Important🚨

⏩All Projectiles is now a Plugin!

Please enable it in your Project ➡️ Project Settings under Plugins.


❇️New Features❇️

⏩New Global Database

The Global Database is an Autoload script that specifically stores Projectiles and Attacks. You can access it at any time by calling the “APDatabase” name.

@onready var projectile_manager: ProjectileManager2D = $ProjectileManager2D
func _ready() -> void:
    var proj: Projectile2D = APDatabase.get_projectile("MAGIC_BOLT")
    projectile_manager.set_projectile(0, APDatabase.get_projectile("FIREBALL"))

By default any ProjectileCaller2D or ProjectileManager2D you create will automatically add its projectiles and attacks to the Global Database at game runtime. Of course, you can modify this behavior.

With this update you can set all your projectiles in one script and use them in another.

You will get copies of the requested projectiles so any changes you make on them will not be reflected on the Global Database allocated projectiles. And of course, you can change these options and use them in your favor.

See more info in the sections below.

⏩Projectiles can now directly call in more projectiles

Spawning new projectiles is as easy as calling up their name, so all Projectile2D have recovered their innate ability to request new projectiles.

All ProjectileBlueprint2D now have the option to spawn Secondary Projectiles once expired.


⚠️Breaking Changes⚠️

⏩Projectiles and Attacks now have Names

In order to store them more easily, all Projectiles and Attacks now have a StringName name property that serves as an identifier in the Global Database


❇️More❇️

⏩ProjectileCaller2D Changes

Added request_projectile_from_database(id: StringName) method.  ## Returns true if the creation request has been successful. 

Added add_projectile_from_database(id: StringName, include_blueprints: bool = false) method.  ## Returns true if successfully added the Projectile2D with the given id at the end of the projectiles Array property; from the Global Database. If “include_blueprints” is true, it will also add the given ProjectileBlueprint2D at the end of the projectile_resorces Array.

Added append_projectiles_from_database(names: Array, include_blueprints: bool = false) method.  ## Appends all the given Projectile2Ds in the “names” parameter Array at the end of the projectiles Array property; from the Global Database. If “include_blueprints” is true, it will also add the given ProjectileBlueprint2Ds at the end of the projectile_resources Array.

Added set_projectile_from_database(index: int, id: StringName, include_blueprints: bool = false) method.  ## Returns true if the element at the given index in the projectiles Array property, was successfully set to the Projectile2D with the given id from the Global Database. If “include_blueprints” is true, it will also set the given ProjectileBlueprint2D at the given index of the projectile_resorces Array.

Added reassing_projectiles_from_database(names: Array, include_blueprints: bool = false) method.  ## Clears the projectiles Array property and sets all its new elements to the Projectile2Ds given in the “names” parameter from the Global Database. If “include_blueprints” is true, it will also clear the projectile_resources Array and set the given ProjectileBlueprint2Ds at the projectile_resorces Array.

⏩ProjectileManager2D Changes

Added add_attack_from_database(id: StringName, include_blueprints: bool = false) method.  ## Returns true if successfully added the Attack2D with the given id at the end of the attacks Array property; from the Global Database. If “include_blueprints” is true, it will also add the given AttackBlueprint2D at the end of the attack_resorces Array.

Added append_attacks_from_database(names: Array, include_blueprints: bool = false) method.  ## Appends all the given Attack2Ds in the “names” parameter Array at the end of the attacks Array property; from the Global Database. If “include_blueprints” is true, it will also add the given AttackBlueprint2Ds at the end of the attack_resources Array.

Added set_attack_from_database(index: int, id: StringName, include_blueprints: bool = false) method.  ## Returns true if the element at the given index in the attacks Array property, was successfully set to the Attack2D with the given id from the Global Database. If “include_blueprints” is true, it will also set the given AttackBlueprint2D at the given index of the attack_resorces Array.

Added reassing_attacks_from_database(names: Array, include_blueprints: bool = false) method.  ## Clears the attacks Array property and sets all its new elements to the Attack2Ds given in the “names” parameter from the Global Database. If “include_blueprints” is true, it will also clear the attack_resources Array and set the given AttackBlueprint2Ds at the attack_resorces Array.

⏩APDatabase Methods

func register_and_get_projectile(blueprint: ProjectileBlueprint2D, return_copy: bool = true)  ## Returns a copy of the newly or already registered Projectile2D from the given blueprint (It also registers the blueprint itself). If “return_copy” is false, it will instead return the reference to the Projectile2D stored in the Database.

func get_projectile(id: StringName, return_copy: bool = true)  ## Returns a copy of the consulted Projectile2D by the given id. If “return_copy” is false, it will instead return the reference to the Projectile2D stored in the Database.

func set_projectile(id: StringName, projectile: Projectile2D)  ## Sets the value of the Projectile2D at the given id, to the given projectile parameter.

func get_projectile_blueprint(id: StringName)  ## Returns the reference of the ProjectileBlueprint2D stored at the given id.

func set_projectile_blueprint(id: StringName, projectile: ProjectileBlueprint2D)   ## Sets the value of the ProjectileBlueprint2D at the given id, to the given projectile parameter.

func register_and_get_attack(blueprint: AttackBlueprint2D, return_copy: bool = true)   ## Returns a copy of the newly or already registered Attack2D from the given blueprint (It also registers the blueprint itself). If “return_copy” is false, it will instead return the reference to the Attack2D stored in the Database.

func get_attack(id: StringName, return_copy: bool = true)   ## Returns a copy of the consulted Attack2D by the given id. If “return_copy” is false, it will instead return the reference to the Attack2D stored in the Database.

func set_attack(id: StringName, attack: Attack2D)   ## Sets the value of the Attack2D at the given id, to the given attack parameter.

func get_attack_blueprint(id: StringName)  ## Returns the reference of the AttackBlueprint2D stored at the given id.

func set_attack_blueprint(id: StringName, attack: AttackBlueprint2D)   ## Sets the value of the AttackBlueprint2D at the given id, to the given attack parameter.

Files

  • all_projectiles.zip 2.3 MB
    15 days ago
  • all-projectiles-godot-project.zip 5.6 MB
    15 days ago
Download All Projectiles
Leave a comment