a store in the game

Discuss game development design and post your game ideas

Post » Sun Dec 02, 2012 4:22 am

So I am making a game where you need to shoot enemies before they reach the end of the screen and I want to be able to have a store and have the player be able to access it anytime they want. I made the store a different layout and when the hit 's' the game will change to the store layout. The only problem is when they go back to the game all the monsters disappear. They start spawning again but I want them to stay in their positions when a player goes to the store.
Posts: 1
Reputation: 577

Post » Sun Dec 02, 2012 4:32 am

You need to store the number of enemies as well as their position at the moment you switch to the shop layout (in an array for example), and add a "loading" of those positions in the "Start of layout" of the "game" layout.

You can find an example of such a shop in the tutorial section of the website.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Posts: 6,938
Reputation: 56,920

Post » Sun Dec 02, 2012 9:37 am

Also another option.

Create HUD like layer called SHOP. The layer is hidden by default.

When the player opens the shop.
Set timescale to 0 to pause the game.
Show layer "SHOP"

on close of shop
hide layer "SHOP"
timescale 1

There might be some trouble with it, but it saves effort in regards to enemy positions and states.... if you go with the prior poster. There is a plugin called Spritebank. Which I think will do what you want.
Posts: 2,455
Reputation: 14,304

Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 1 guest