still need help with shields not spawning on trigger plse

0 favourites
  • 6 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Been trying to figure this out for a couple of weeks now.

    The player (ball) rolls around on disks and destroys stars, getting points for each star. After a certain number of stars have been destroyed, an achievement is triggered and a set number of power-ups (shields) are awarded.

    Right now, i'm testing with the shields being awarded after the 5th, 10th and 15th stars are destroyed.

    The problem: if the player falls off a disk and has only destroyed 4 stars, the next time the layout starts, since the disks are created at random positions with the stars pinned to them, the ball can and most of the time will spawn on top of 2 or more disks directly overlapping each other. This destroys 2 or more stars within 0.01 secs. In doing this, the number of stars jumps from 4 (the number before the player died) to 6 or more, and the shields are not awarded and they do not spawn. This can also happen with the 10th and 15th achievement trigger.

    I don't know why, since the system has to count the 5th star to get to the 6th. If the player does not die, and scores the 4th, 5th and 6th stars, the shields are awarded and spawned as they should be.

    If anyone can take a look and see what i'm doing wrong, or suggest a workaround, it would be more than greatly appreciated.

    CAPX

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Are you sure you want the game to be designed such that you fall onto a bunch of stars on spawning and don't even have to collect them? I would just make sure the player spawns on an empty disc always and go from there. If you do want it to do this then I guess i can take another look.

  • Are you sure you want the game to be designed such that you fall onto a bunch of stars on spawning and don't even have to collect them? I would just make sure the player spawns on an empty disc always and go from there. If you do want it to do this then I guess i can take another look.

    Thanks for the reply. After some trial and error, i had the system randomly choosing between 2 disks that have either the 90 or 180 motion created center of layout without the stars. . That worked fairly well, except the disks/stars would still be randomly created, so they could still be created underneath the disks that DO NOT have the stars.

    I tried only creating non-star disks at layout start, but there was so much dead time from the start of play to when the actual disks/stars entered the gameplay.

    Even if i could make it so the ball would not be created on top of multiple stars, in reality it could still collide with stars that are directly on top of one another. Which brings us back to the original problem.

    How to get the system from jumping over that 'trigger' star number.

    I am surely open for anything that works. Well, anything that i have the brain power for.

  • p.s

    I've got it to this point, shields spawn correctly for the most part.

    CAPX

    To test, you can lower the number of stars needed on the 'Achievements" event sheet.

  • I think your game is detailed enough now to work out an order or structure and game flow, like what exactly you want to happen when the game starts. Do you want the player to be thrown straight in? I've edited the capx here, I've blocked out the collection of stars on spawning with a global variable it's as easy as that. Essentially it means that the player will land on a star initially but it won't be collected. https://dl.dropboxusercontent.com/u/495 ... hecks.capx

  • That works. Thanks for that.

    Do you want the player to be thrown straight in?

    No. I've been working on a countdown when the actual gameplay layout starts. As in: 3... 2... 1... The numbers appear and fade just fine, along with the game starting as it should. Having trouble trying to get the numbers to increase in size just a bit, though.

    Again, thank you for all your help and patience.

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