Two Disturbing Issues with Galaga/Brickbreaker Hybrid Game

For questions about using Classic.

Post » Fri Dec 04, 2009 11:17 pm

Hello all, a friend and I are trying to put together an arcade-style game in Construct for our gaming class. We've mostly gotten it put together, but there are a couple of gamebreaking issues mystifying us that seem to have developed out of nowhere.

The primary mechanic in the game is using a bouncing bomb suspended between two paddles (tracking the X movement of the paddles) to destroy waves of enemies coming in from the right side of the screen. Unfortunately, for some strange reason after about a minute and a half the bomb starts inexplicably slow down while all the other elements remain at normal flow.

Using the Debug mode, we determined that the speed of the bomb -is not changing-; that is to say, it's staying at its upper bound of 500, yet somehow its motion is slowing until it breaks the game experience.

Additionally, I cannot seem to get a Replay mechanism to work. Currently, I have three layouts, Start, Game, and End, and in the end layout set all relevant variables back to what their default values should be and then move the player back to the second layout. This works fine, except for the fact that all time-related events for whatever reason don't work immediately, and in fact only start work at some seemingly-random interval of time.

Here's a link to a zip containing the cap file and the assets folder with a kickass music track composed by a friend of mine, for your listening (and troubleshooting) pleasure: http://www.megaupload.com/?d=9OWO8QF4

Please aid us! This may or may not be due, er, very, very shortly.
B
1
G
3
Posts: 5
Reputation: 835

Post » Fri Dec 04, 2009 11:31 pm

well, it seems the file is "temporarily disabled".


Cue the hordes of people telling you to use dropbox or box.net so we can actually download the file.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Dec 05, 2009 12:11 am

Heh, that's odd, on most places I post things I get yelled at if I don't use Megaupload! I looked at Megaupload from a friend's computer and had no trouble accessing it, reload the page perhaps?

Update: I don't understand how to just give a link to a Dropbox folder. If you have an email address, I can just send the invite to the shared folder to you? Please advise.
B
1
G
3
Posts: 5
Reputation: 835

Post » Sat Dec 05, 2009 12:32 am

I could download it.
I'm using 0.99.62.. for some reason this game crashed on me after 30 seconds to a couple of minutes. Except for this last try, where I could see the behavior your described. At least I THINK the ball/bomb slowed down.

I haven't worked with "Timer", so I'm confused about evaluating Timer>0 in so many places. It appears after one second Timer is always going to be above zero.

And I'm not sure if "Every 30000 * (1 + random(3) ) milliseconds" is actually viable or not. Maybe someone else knows?
Likewise with "Every global('SpawnRate') milliseconds".
I've just not tried that kind of thing before.

Edit: As for links to Dropbox - if you put it in the "Public" folder, then you can click on the file there, and "Copy public link", and hand that out.
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Sat Dec 05, 2009 12:44 am

The tricks with Timer seem to be viable, I mean... they're working for me as intended.

As for the Timer>0 check in so many places, it seemed that whenever I tried something as, say, 'Every 30,000 milliseconds' it would proc once at 0 seconds, so, the start of the layout. Making sure that it only procs when Timer is above 0 removed that issue.

Either way, none of the Timer events should affect my bomb like that.. and I have no idea what's causing the random crashing, I opened up my file today and now for some reason it crashes every so often, despite my not having messed with the code at all.

I'm, as a I said, mystified.
B
1
G
3
Posts: 5
Reputation: 835

Post » Sat Dec 05, 2009 12:49 am

Hmm, okay then. I was chasing the wrong thing, anyways.

I managed to fix the problem where the ship spawn events wouldn't work right after losing and restarting. To fix it:
Change your layout transition style from "Fade" to "None" in both the Event Sheet and End Events sheets.

I experimented changing things to use simply set times, every 2500 ms, that kind of thing, and it didn't fix it.. but changing it from Fade to None layout transition works.


(Also, totally unrelated to any issues here; it's not an issue, and it doesn't seem to affect anything in this case, but in the future: You could use a MouseKeyboard object in just one layout, and set it global. Then you don't need to place a MouseKeyboard in other layouts, and you can use it in their event sheets too.)
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Sat Dec 05, 2009 1:03 am

I totally know what's going on with the bomb, too. Notice in debug mode how the bomb's angle is always increasing further away from its starting angle?
In other words, it's sloowly turning toward heading sideways. Your event is always moving it to your paddle X position, certainly, but.. let's say you could disable it for a moment in gameplay. You'd see the ball heading rather sideways, with little vertical velocity. Most of its speed would be going toward moving it horizontally.

You might want to either limit its angles to -90 and 90 only, or make something custom that always goes up and down between the top and bottom boundaries or some set Y positions. I don't know what would be best.
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Sat Dec 05, 2009 2:51 am

Thanks for the help, guys, you're brilliant! Implementing the suggestions now.
B
1
G
3
Posts: 5
Reputation: 835

Post » Sat Dec 05, 2009 3:06 am

So, how exactly would I go about limited its angles to -90 and 90? I tried having a couple events, so that if angle > 0 it becomes 90, and if angle < 0 it becomes -90, but that doesn't seem to work.
B
1
G
3
Posts: 5
Reputation: 835

Post » Sun Dec 06, 2009 12:36 pm

I'm.. not sure. I'd suggest changing from ball behavior to bullet behavior, or 8-direction or something else if that doesn't work out right.
Start the bullet facing straight down. When it hits a wall, if it was going at -90 make it go at 90.
If that breaks for some reason, make a new variable set to 0. When the bullet hits a wall and the variable's 0, set the variable to 1 and make the bullet face up. If the bullet hits a wall and the variable's 1, set the variable to 0 and make the bullet face down.
Or work with Y positions. If it goes down past Y position something, make it angled up. If it goes up past the Y position there, make it angled down.
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests