#40331 - chrissieboy - Sun Apr 17, 2005 5:13 pm
HI all,
im making a game like breakout, and with use of the touch screen.
Everything was going really well, but now i got a weird problem..
My ball is moving on the touch screen, and when it lefts the touchscreen and goes to the up screen the problems begin.
I made this collision code to detect if the touchscreen is leaving and that my sprite must going furthur on the upscreen.
i made this code :
speed is the speed i declared that is 2<<8
But the problem is that when it is in the up screen and it bounced to the top of that screen, then it bounces down.
And on a half of the screen the ball disapears and starts again from point 172<<8??
I dont know whats the problem with this script??
Im busy with it for a whole day know..
So i had take a look on josath his page and downloaded the birds demo.
Because this one uses both screens, and i saw that he had made a code for it.
But i had use aronroogers.com his nds dev setup, but i cant compile the birds demo it gives a lot of errors.
And in his text files i saw that it would not compile with this setup.
So PLEASE can someone help me or you josath?????
Very much thanx!!
Last edited by chrissieboy on Sun Apr 17, 2005 6:36 pm; edited 2 times in total
im making a game like breakout, and with use of the touch screen.
Everything was going really well, but now i got a weird problem..
My ball is moving on the touch screen, and when it lefts the touchscreen and goes to the up screen the problems begin.
I made this collision code to detect if the touchscreen is leaving and that my sprite must going furthur on the upscreen.
i made this code :
Code: |
// x as touchscreen if (sprites[ball_on_touchscreen].x>236<<8) { sprites[ball_on_touchscreen]xSpeed=(-speed); } if (sprites[ball_on_touchscreen]x<4<<8) { sprites[ball_on_touchscreen].xSpeed=(speed); } // y as touchscreen if (sprites[ball_on_touchscreen].y>172<<8) { sprites[ball_on_touchscreen].ySpeed=(-speed); } if (sprites[ball_on_touchscreen].y<4<<8) { sprites[ball_on_touchscreen].x=sprites[ball_on_touchscreen].x; sprites[ball_on_touchscreen].y=170<<8; sprites[ball_on_touchscreen].xSpeed = sprites[ball_on_touchscreen].xSpeed; sprites[ball_on_touchscreen].ySpeed = sprites[ball_on_touchscreen].xSpeed; } if (sprites[ball_on_touchscreen].y>1<<8 && sprites[ball_on_touchscreen].y<170<<8) { ball_moves_on_touchscreen = true; } //---------------------------------------------------- // The up screen if (sprites[ball_on_upscreen].x>236<<8) { sprites[ball_on_upscreen].xSpeed=(-speed); } if (sprites[ball_on_upscreen].x<4<<8) { sprites[ball_on_upscreen].xSpeed=(speed); } // y as touchscreen if (sprites[ball_on_upscreen].y>172<<8) { sprites[ball_on_upscreen].ySpeed=(-speed); } if (sprites[ball_on_upscreen].y<2<<8) { sprites[ball_on_upscreen].ySpeed=(speed); } if (sprites[ball_on_upscreen].y<140<<8) { ball_moves_on_touchscreen = false; } |
speed is the speed i declared that is 2<<8
But the problem is that when it is in the up screen and it bounced to the top of that screen, then it bounces down.
And on a half of the screen the ball disapears and starts again from point 172<<8??
I dont know whats the problem with this script??
Im busy with it for a whole day know..
So i had take a look on josath his page and downloaded the birds demo.
Because this one uses both screens, and i saw that he had made a code for it.
But i had use aronroogers.com his nds dev setup, but i cant compile the birds demo it gives a lot of errors.
And in his text files i saw that it would not compile with this setup.
So PLEASE can someone help me or you josath?????
Very much thanx!!
Last edited by chrissieboy on Sun Apr 17, 2005 6:36 pm; edited 2 times in total