How to make a store in my game?

Hi everyone,
I followed this tut and completed it from t-shirt booth.




I have made the store already, but I don't know how to make the items usable in game.

For example:

I have $100
I then buy a bomb for $50
Now I have one bomb

I start the first level of my game.

How do I get the bomb I bought to be usable?

when I do use it, i then need it to subtract one bomb from my inventory.

I now need to go buy more bombs.


Please if anybody knows the answer I would much appreciate it. Or if you know where I can find an answer.

Thank you for your time

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    You would add to the bombcount attribute when you purchase a bomb. Then, when you want to use it, have a rule that says something like this:

    When touch is pressed, and when bombcount is great than 0 (or 1),
    You would then tell the game what to do when you use a bomb.
    Then add a change attribute
    Change attribute game.bombcount to game.bombcount-1
  • bobtheturtlebobtheturtle Member Posts: 226
    Thank you for the support Braydon_SFX. However, I still cant get it to work, Is there a demo I could look at or a video that might also explain it?

    In my game,
    when I click on the "change weapon" button, I need it to make sure the player has bought at least 1 bomb, and then if he has bought the bomb change the weapon to the bomb. Otherwise self.color aplha =0



  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375
    if you need some help, either pm me or email me at bjandthekatz@gmail.com
  • bobtheturtlebobtheturtle Member Posts: 226
    PM sent, and in the mean time I am still open to some suggestions :)
  • bobtheturtlebobtheturtle Member Posts: 226
    please additional info.
Sign In or Register to comment.