My Broken Game

For questions about using Classic.

Post » Sat Nov 07, 2009 11:06 am

Well, in utter desperation as the competition ends tomorrow, I'm going to post my .cap for the Minimalism contest. I just cannot figure out what is wrong with it. Everything works, except for the fact that when the main character shoots, he shoots two bullets. I've tried isolating code, rewriting code, everything I can possibly think of and it just does not work. Very frustrating. Anyway, if someone wants to look it over, see if they can tell what's happening, I'd really appreciate it.

Hmmm, in hindsight, this may be asking a bit too much... Ah well, I may have missed something obvious. But don't waste too much time or anything.

http://dl.dropbox.com/u/1378330/aaargh.cap
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Sat Nov 07, 2009 11:23 am

Seems one needs the Advanced Camera plugin to open this cap.

Oh well, I can only speculate at this point. If the bullet is duplicating, then it must be a duplicated trigger, event or action. It may not be always apparent; are you using two instances of Mouse and Keyboard object? Only one global instance is enough. Next check any conditions related to firing; perhaps it is allowing two triggers before it clams. Then check actions, sometimes it is not apparent but some people mistakenly duplicate the spawning event.

Moreover, check if the bullet isn't in a container with another bullet, though that sounds silly by itself - objects cannot be containers of themselves.

Just a few tips to tide you over until someone with the camera plugin can dig in.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sat Nov 07, 2009 11:25 am

Hey cow_trix, that's a cool game! :D

In your base event sheet in event 39 try to substract 0.5 from ammo and not 1. That seems to work for me. Probably you would have to do the same for event 38, which I assume is when the weapon is upgraded.

Don't ask me why that is, but I had a situation like this before and when I substraced half the amount it logically should be, it worked. Then again I don't have full overview what's going on in your events. But the change seems to make it work! 8)
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sun Nov 08, 2009 2:57 am

[quote="Mipey":fhs5ub4t]It may not be always apparent; are you using two instances of Mouse and Keyboard object?[/quote:fhs5ub4t]

Thankyou good sir! That was indeed the problem. And thanks also PixelRebirth, that worked too (although it means the bullets do twice as much damage).
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Sun Nov 08, 2009 9:09 am

[quote="mipey":yd6p92mz]It may not be always apparent; are you using two instances of Mouse and Keyboard object?[/quote:yd6p92mz]

Hey, that might also explain the old bug I had in the back of my mind. If only I could figure out which cap that was and revisit it...

Need to keep this in the back of my mind from now on! :|
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests