User Tag List

Results 1 to 3 of 3

Thread: Event for player lives as reduced by 1?

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2007
    Location
    UK
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Event for player lives as reduced by 1?

    This doesn't seem to be possible...? To create spawn points in my flick-screen platform game I added an alterable value to the player called Respawn. At the start of the game this is set to 0. When the player looses a life in the first room his position should be moved to the start. Once the player has hit one of the actives that transits from one room to another he changes the respawn value. So a respawn value of 1 sets his respawn position to elsewhere in the room - it all depends where in the room the player died based on which entrance they came through.

    The problem is not being able to detect that the players lives have reduced by 1. This does not seem to be an available option. Saying number of lives is less than 4 is no good because the player's position will continue to be moved while on 3 lives!

    The only solution I can think of is changing the players position in the collision with an enemy in the room (with the respawn value also) but I was hoping to avoid this so I could put all room respawns in the same event group and also because all enemies can appear in different rooms and are all have the enemy group as a qualifier to kill the player (using a loop called "lose_life").

    EDIT

    It would also seem that even when the player's number of lives = 0 the jump to frame number event doesn't work. It does if I use the hearts life counter but not if using numbers. Is this a bug?

  2. #2
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2007
    Location
    UK
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I have it sussed now but I still can't get the end frame to start when the player has lost all lives.



    In the above code you can see that contact with enemies and bads starts the lose_life loop 1 time.

    On that loop it plays the death sound and subtracts 1 from the number of lives of player 1.

    A separate on loop event for the same checks if the number lives is 0 and jumps to frame 8 (game over screen).
    Extension to that is the proviso that Global value A = 0 (cheat mode makes the global value A = 1 so the player never dies, just loses lives).

    Finally, the bit I original asked help with, on the lose_life loop if the players number of lives is more than 0 and the Respawn value of player is 0 (first room) then move player position to the starting area of the first room (and the detector along with it).

    This means in the Respawn event group I can add an event for each room where the player changes the Respawn value (when colliding with the room transition objects) so the players position is always reset to the most appropriate place depending on where they died in the room.

    This all works apart from the game over screen not appearing when lives are 0. I've also tried the above without the global value A = 0, just in case I screwed that up.

    EDIT

    And here's the lives counter



    By default the number of player lives is 3 but I have a start of frame event to change that to 4.

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2007
    Location
    UK
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, I am a dummy. I was testing the frame not the application - therefore it won't jump to another frame. Hnggg.

    *smacks palm of hand into face, hard.

    So, this post was a waste of time because I've fixed my own issues. Perhaps it should remain for that code in case anyone else would like a fastloop lives event and respawns...?

Similar Threads

  1. Prevent the player from doing anything during an event
    By YeOldeLuke in forum Fusion 2.5
    Replies: 10
    Last Post: 11th February 2015, 02:38 PM
  2. Replies: 9
    Last Post: 2nd December 2014, 06:59 AM
  3. Animation reduced to 3 colurs
    By RayMarble in forum The Games Factory 2 - Technical Support
    Replies: 6
    Last Post: 4th September 2010, 09:04 AM
  4. How do I add Player Object 2 to the Event Editor?
    By fawfulfan in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 4th September 2009, 09:40 PM
  5. player/lives
    By Taco in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 29th August 2007, 04:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •