Ball moving like arkanoid or brick game

Blitz3D Forums/Blitz3D Beginners Area/Ball moving like arkanoid or brick game

jimmyx(Posted 2006) [#1]
Hello Fellow coders

id like to make a ball deflect and move around a 800,600 screen.

im using sprite candy how can i do a 2d version but for blitz3d +sprite candy , or just blitz3d if you dont have sprite candy



thanks


WolRon(Posted 2006) [#2]
What is sprite candy?

EDIT: Ah, I see now: http://www.x-pressive.com/SpriteCandy/


SheepOnMintSauce(Posted 2006) [#3]
I'm not sure if you mean like this or not. But, I did this a while ago trying stuff out.



I imagine there's probably an better way to do this though.


Jake L.(Posted 2006) [#4]
Make your ball have a X- and Y-Speed, adding this values to the ball's position each frame

If it hits a wall, just flip the corresponding axis like so:

If ball_x_pos < 0 then ball_x_speed= -ball_x_speed

Use HUD_SetObjectOrigin (ball,0,0) to center the handle after loading/creating your ball.