How do I respawn

0 favourites
  • 9 posts
  • 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.

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

  • 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

  • > 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.

  • >

    > > 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?

  • 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 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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'

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