In-game Store

Get help using Construct 2

Post » Sun Feb 24, 2013 8:35 am

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 retrodude2013-02-24 08:36:02
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Mon Feb 25, 2013 2:12 pm

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.
B
12
S
3
G
1
Posts: 120
Reputation: 1,829

Post » Tue Feb 26, 2013 12:30 am

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.
B
18
S
5
G
3
Posts: 158
Reputation: 4,813

Post » Wed Feb 27, 2013 5:06 am

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

[QUOTE=Kuso] 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.[/QUOTE]
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Wed Feb 27, 2013 5:25 am

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?
B
12
S
3
G
4
Posts: 56
Reputation: 3,235

Post » Wed Feb 27, 2013 11:30 pm

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

[QUOTE=r4dicaldreamer] 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?[/QUOTE]
B
18
S
4
G
3
Posts: 436
Reputation: 4,801


Return to How do I....?

Who is online

Users browsing this forum: Timedoor Indones and 30 guests