Hi datiel12, I also tried to do that some time ago, after some experimentation, I figured out how to do that with some arrays and a single weapon object type with several animations.
You can find a full example of that buying my game template <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> (https://www.scirra.com/store/royalty-fr ... plate-2942).
But I'll give you some tips here:
- Have just one weapon object type. With its jj_Weapon behavior.
- Make it have an animation for each weapon kind.
- Have a bi-dimensional array with the statistics of all weapons. Where first axis is the weapon index and second axis are weapons values. Like this:
|0:Animation|1:Shoot interval|2:Clip size|3:Stock size|4:Clip|5:Stock|6:Reload time
0 | Pistol | 300| 12| 128| 0| 0| 1800
1 | Magnum | 400| 6| 30| 0| 0| 4000
....
[/code:1mc0rdsy]
- Have a second uni-dimensional array with the weapons the player has. It shall contain just the weapon indexes. It will be empty at the beginning.
- Give the player a CurrentWeapon instance variable.
- Have a function for each weapon type which sole purpose is to set the Bullet instance for the weapon.
Those are the ingredients, I'll be giving the recipe in a next post (I have to go to my job now).
Hope this help you point to the right direction <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">
Is there a tutorial on how to use this? Like an inventory System Or Something like
(Top Down)
I have 3 Weapons in game.
The player starts out with one weapon. and then when the player collects the second weapon, the player can scroll between the 2 weapons. then the player picks up the third weapon and now the player can scroll between all 3.
Anyway to do something like that with this plugin?