Objects Should Disappear/ Checkpoints
#1
Posted 12 October 2008 - 03:52 PM
some questions here ..
1)I have a little problem with objects. For example, I set an life object and take it. If I die, the room should be
restarted but the object should be gone because I took it already. How to make the object disappear for the rest of the game if I took it ??
2) I' m wondering how to create Checkpoints during the game. When the character dies
he shouldn't restart the whole room but start from the checkpoint .
need answers ...
#2
Posted 12 October 2008 - 04:31 PM
It should probably look like this. global.destroy_object()
I am 84% sure that will work.
Please feel free to correct me.
Edited by Barrel_Roll, 12 October 2008 - 04:34 PM.
#3
Posted 12 October 2008 - 04:38 PM
You have multiple options there.How to make the object disappear for the rest of the game if I took it ??
I would suggest you do not destroy the player, but just move it, when it gets killed, back to its starting-position :
X: xstart
Y: ystart
(eventually you can reset the player by creating a new one at those "xstart" and "ystart" coordinates and destroy the old one)
When you use the above method (with those "xstart" and "ystart" variables) you could, when your player collides with such a waypoint-object, just copy the current "x" and "y" into the "xstart" and "ystart" variables.2) I' m wondering how to create Checkpoints during the game.
Hope that helps.
#4
Posted 12 October 2008 - 04:42 PM
I don't feel safe to use scripts ^^
I have no experiences with scriptz and cannot work with them, for sure
#5
Posted 12 October 2008 - 04:44 PM
For the life object's event
If global.lifeObjectDisplay = false
{ instance_destroy() }
(I'm not gonna use a codebox for just 2 lines. >.>)
---
2. Maybe use a checkpoint object like the lamp posts in the sonic games. When the player collides with it, make an event that plays a 'checkpoint' sound, animates it a bit, and sets player coordinates.
Like, say, if you put the checkpoint at 1299, 583 then put in the CHECKPOINT's collission event (in caps because its important):
global.playerRespawnX = x
global.playerRespawnY = y
Then, in whatever event you have for player death (just use the room's creation code if death means room_restart() )
player.x = playerRespawnX
player.y = playerRespawnY
That'll put the player (if that's the player object's name) where the checkpoint is if he/she touched it before.
The ONLY thing I can think of that might be bad about this is that one can hit checkpoints out of order and that'd hurt more than help them.
(Guh... so many replies while I was posting. x_x; Well, now's a good time to learn, anyway. I would say implement the first one in code just to get used to it, seeing as it only takes like 2 or 3 lines. ^_~ )
Edited by Rainsong, 12 October 2008 - 04:46 PM.
#6
Posted 12 October 2008 - 04:44 PM
Hmm...
I don't feel safe to use scripts ^^
I have no experiences with scriptz and cannot work with them, for sure
There may be a D&D equivalent, but I'm not going to look for it.
I'd listen to ragarnak, his thing will probably have less room for error than mine.
Edited by Barrel_Roll, 12 October 2008 - 04:46 PM.
#7
Posted 12 October 2008 - 05:09 PM
is nice but when the player dies there is no transition and it looks not good. Can I make a transition effect by myself or
do I need to have the Pro Edition ???
#8
Posted 12 October 2008 - 05:20 PM
Ofcourse you can ! Even with the "light" version you can make all sorts of effects. Maybe not all of them, but several nonetheless.Can I make a transition effect by myself or
#9
Posted 27 October 2008 - 02:20 AM
Object: character
Collision with checkpoint = save game, destroy object
button (your choice) = load game
OR
do the save game part, but instead you can do....
collision (object) = LIVES (Relative) -1, if lives is lower than 1 load game
I hope this helps!!!
- Chris32
#10
Posted 13 July 2009 - 10:01 PM
#11
Posted 14 July 2009 - 03:35 AM
The last time I called myself that is a long time ago.And you call yourselves intermediate users!
Doesn't that ("stay the same always") mean that the the dead player will stay where it is too, and won't be set back to its starting position ?Just set the room to persistant so it'll stay the same always when you reenter/restart it.
And a remark : didn't you notice that the question is about 8 months old (meaning that probably nobody will be looking for a solution anymore) ?
#12
Posted 04 April 2013 - 09:53 PM
Hmm...
I don't feel safe to use scripts ^^
I have no experiences with scriptz and cannot work with them, for sure
I'm the same way. Im so confused ![]()
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











