How do I respawn

Get help using Construct 2

Post » Thu Dec 31, 2015 9:07 pm

I'm working on death and respawn and reloading the layout after going to the main menu but I'm not getting my player respwan and the layout wont reload cause of the main menu.

how would I create another player instance randomly.
B
10
S
4
Posts: 144
Reputation: 1,246

Post » Thu Dec 31, 2015 9:09 pm

I'm afraid that without seeing your capx and/or events this question can not be answered..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Dec 31, 2015 9:11 pm

LittleStain wrote:I'm afraid that without seeing your capx and/or events this question can not be answered..


would a link to a vid of what my game is now help
B
10
S
4
Posts: 144
Reputation: 1,246

Post » Thu Dec 31, 2015 9:14 pm

jamiek wrote:
LittleStain wrote:I'm afraid that without seeing your capx and/or events this question can not be answered..


would a link to a vid of what my game is now help


To prevent pointless posting and guesswork, it is preferable to either provide screenshots of your Events or a .capx.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
78
Posts: 5,200
Reputation: 54,807

Post » Thu Dec 31, 2015 9:24 pm

zenox98 wrote:
jamiek wrote:
LittleStain wrote:I'm afraid that without seeing your capx and/or events this question can not be answered..


would a link to a vid of what my game is now help


To prevent pointless posting and guesswork, it is preferable to either provide screenshots of your Events or a .capx.


can I even post links yet?
B
10
S
4
Posts: 144
Reputation: 1,246

Post » Fri Jan 01, 2016 5:22 am

I get what you want make a new variable a global one called Lives let say you have three lives so onstart of main game layout make it three.

And run this for death, On destroyed then sub event If player has more then 0 lives then restart the layout and another sub event If player lives = 0, this is your choice Either use a game over to restart or do a go to main menu.

Is this what you asking for ?
B
51
S
24
G
6
Posts: 391
Reputation: 7,820

Post » Fri Jan 01, 2016 3:44 pm

Gearworkdragon wrote:I get what you want make a new variable a global one called Lives let say you have three lives so onstart of main game layout make it three.

And run this for death, On destroyed then sub event If player has more then 0 lives then restart the layout and another sub event If player lives = 0, this is your choice Either use a game over to restart or do a go to main menu.

Is this what you asking for ?


I only want one life

I have a global variable and trying to restart the layout but it wont work. I had a game over screen that would loop or the main menu would loop and the player wont respawn. how can I respawn the player in a random postion.
B
10
S
4
Posts: 144
Reputation: 1,246

Post » Sat Jan 02, 2016 5:55 am

Define random position? like whole layout or like special places to respawn kinda like counter strike?

If whole layout you can do something like Onstartlayout--> move player to Random X , Y. And if i remember correctly you had to also do something like Min max X value and Y value of your layout to prevent spawning outside of layout.

If you want specific but special place to respawn at you can create a bunch of sprite and label then spawn A, spawn B, spawn C, etc to how ever you want and then you can do something like global variable spawn point=0 and then do something like onstartlayout->global variable Choose number (1,2,3,..etc)

Another event for each spawn such as If 2 is chosen then move to spawn B.
And then after that under it i would add If global variable is >0 then make it equal to 0 so that it doesnt lock up the player to that spawn point only.

I prefer the specific spawn point but random because you can effective choose where to spawn and not have to worry about too many bugs.
B
51
S
24
G
6
Posts: 391
Reputation: 7,820

Post » Mon Jan 04, 2016 6:45 pm

Gearworkdragon wrote:Define random position? like whole layout or like special places to respawn kinda like counter strike?

If whole layout you can do something like Onstartlayout--> move player to Random X , Y. And if i remember correctly you had to also do something like Min max X value and Y value of your layout to prevent spawning outside of layout.

If you want specific but special place to respawn at you can create a bunch of sprite and label then spawn A, spawn B, spawn C, etc to how ever you want and then you can do something like global variable spawn point=0 and then do something like onstartlayout->global variable Choose number (1,2,3,..etc)

Another event for each spawn such as If 2 is chosen then move to spawn B.
And then after that under it i would add If global variable is >0 then make it equal to 0 so that it doesnt lock up the player to that spawn point only.

I prefer the specific spawn point but random because you can effective choose where to spawn and not have to worry about too many bugs.


your first would work best, how would that work with restart layout to make every event trigger properly. I'm having trouble restarting the layout after going to the 'main menu'
B
10
S
4
Posts: 144
Reputation: 1,246


Return to How do I....?

Who is online

Users browsing this forum: CJacobsSA, SneakyHands and 6 guests