How to diagnose phantom/invisible sprites

Discussion and feedback on Construct 2

Post » Mon Feb 25, 2013 6:40 am

I have a game modified off of the simple Vertical Space Shooter template. The 'enemy' sprites are generated every second, and I have a animation frame of 26 images, for which I assign one at random when the new sprite is created. (Each sprite represents an object starting with one of the letters of the alphabet).

I have another sprite that moves around to collect these items, and collision detection seems to work fine... except

there appear to be sprites generated which don't appear visually but do trigger the collision detection. I captured some of the properties to the screen in other fields and they look like legitimate objects, they just aren't displaying (as if opacity were 0 - but it's not).

I even see one triggered way before it's logically even generated - since I have a 8 second delay (for reading a message screen) before I start the object generation, but a collision is detected pretty much as soon as the layout starts.

Any ideas on how to track this down?
B
4
Posts: 6
Reputation: 587

Post » Mon Feb 25, 2013 7:35 am

Easiest way would be to post your capx file so we can take a look for you. Otherwise, we're just throwing guesses into the wind.

There's probably something off about your events. It's checking for collisions differently than you're intending, your conditions for spawning objects triggers when you don't want it too, something like that. But we can't say for sure without seeing it.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Mon Feb 25, 2013 7:36 am

Posting your .capx here might be a good start... :)
B
8
S
2
G
3
Posts: 83
Reputation: 2,668

Post » Mon Feb 25, 2013 4:15 pm

Thanks for the offer of looking at the code! Capx is here: http://bit.ly/X9BmLv (it's my first project so if I'm doing anything "bad" would love to know).

There's some randomness to the whole thing, so on the Game layout, if you just let it run without moving the guy, you'll likely see a phantom collision within a minute or so.
B
4
Posts: 6
Reputation: 587

Post » Mon Feb 25, 2013 7:00 pm

Not sure what's happening there but printing out the position of the target in the collision event shows that the fist is colliding with newly spawned targets that are up off the top of the screen. I'd say it's something to do with collision detection between objects on different layers. If you put the fist on the "Game" layer it doesn't happen.
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990


Return to Construct 2 General

Who is online

Users browsing this forum: humanescape and 8 guests