In-game Store

0 favourites
  • 6 posts
From the Asset Store
Instantly Create Rogue-like Adventures with just 1 Layout! Include this IGM into any existing games.
  • I was wondering if anyone could direct me in making an in-game store, not a real cash store where the player has to invest there own money but rather a collect coins in-game to buy equipment store.

    Basically I have a character sprite that has a weapon sprite attach to it and I want to make it so that when the player gets some coins in game they can go to the main menu, enter the shop and then switch the weapon sprite with another weapon sprite after they buy a weapon using the coins they collect in-game.

    The main problem is I'm not sure how to do this. Would I have one weapon with a bunch of animations? Or would I have different sets of weapon sprites all with seperate animations? Also how would the choices made in the menu store transfer to the game?

    I would appreciate any pseudo code, examples, logic or even maybe an idea on how I can do this so I could try it out

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I'm kinda new to C2 but i can tell you how would i do it.

    Its always better to have all weapons in 1 sprite and change the frames or animations, that is how you wont need to create/destroy sprites every time.

    For the shop menu i would made it in the same sheet in inactive group so when player presses certain button you Set Group "Shop" Active, and then all the changes one makes in shop will easily applied to the game.

  • Like Palkost say, you can make a sprite named "weapon" and inside, all the weapons animations (swordstand, swordattacking, axestand, axeattacking, etc). With events, you can call the animations when the main character have a weapon in his hands.

    For example:

    If hero.weapon = 1 -> weapon set animation "swordstand"

    If hero.weapon = 2 -> weapon set animation "axestand"

    Of that form, you only have 1 sprite and not need destroy and create a weapon sprite every time the hero gets a new weapon.

  • Yea I see what you mean, also fps wise it would generally slow down my game even if I were to destroy all the sprite objects in the beginning. It would probably be best to have 1 sprite object with multiple animations.

    Thanks for the input, same goes for Palkost <img src="smileys/smiley17.gif" border="0" align="middle" />

    Like Palkost say, you can make a sprite named "weapon" and inside, all the weapons animations (swordstand, swordattacking, axestand, axeattacking, etc). With events, you can call the animations when the main character have a weapon in his hands.

    For example:

    If hero.weapon = 1 -> weapon set animation "swordstand"

    If hero.weapon = 2 -> weapon set animation "axestand"

    Of that form, you only have 1 sprite and not need destroy and create a weapon sprite every time the hero gets a new weapon.

  • Interesting...I also had some issue with it, this will help :)

    by the way, how will you store the information of your items? you go out to main menu, access store and buy anything, and then back to the game

    I'm not really familiar with data storage though, so maybe you can share any knowledge about it?

  • I haven't yet tryed it out since I'm fairly busy, but there is a tutorial on an example of how it works

    Interesting...I also had some issue with it, this will help :)

    by the way, how will you store the information of your items? you go out to main menu, access store and buy anything, and then back to the game

    I'm not really familiar with data storage though, so maybe you can share any knowledge about it?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)