Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by programlocura

Hi everyone,

I'm having some troubles with this. It's a annoying bug because it can't always be reproduced, it happens sometimes.

I have a menu state where i'm drawing a title screen with 4 options (Play, achivements, challenges and extras), when i press the "play" button, the menu's background remains on the "game state" screen.

Into the game state i'm doing a random search in a four backgrounds range, selecting one and showing it, all in the "init" method.
If that variable exists, i'm drawing the selected background on the "draw" method.

I'm enclosing a screenshot with the problem.

Thanks in advance.

/>			</div>
		</div>
			<div class=

1 decade ago by Graphikos

You sure it's not just crashing on something? What's your console say?

Very hard to debug this without code.

1 decade ago by mLautz

Definitely hard to do without code. However, one guess is that you may not be calling
this.parent()

in your draw function, which normally clears the screen of the previous frame before drawing the new one.

1 decade ago by programlocura

Thanks for your answers!

It was a very silly bug. I was drawing a background from 3 availables, and the random number was a number out of the array range.

Thank you all,
Sorry for waste your time.
Page 1 of 1
« first « previous next › last »