arkanoid
arkanoid
hi
i want to make an arkanoid game.i want to keep it simple so i dont want to any physics.probably it will be with simple 3d graphics but in 2d motion in general.
i dont have yet wrote i single line.i am planning at the moment.i'd the the help of anyone,if he can,for some question i have
i think the code of the ball's motion will be something like this
it's going to have a X_speed and a Y_speed.the values of x and y i guess wil coming from a simple line function.
you know, if i want the ball to moving in 45o angle, then we'll have
x=a*y -> a=1 -> x=y
when the ball collides with the bricks the motion of the ball will change into this:
collides with the upper or the down edge of the brick -> x*=-1 (x for vertical,y for horizontal)
collides with the left or right edge of the brick -> y*=-1
(if i make mistakes correct me)
if collision occur between ball and paddle then proportionally how far from the center of the paddle were the collision,it will take and a concrete angle of move.
my questions of course are:
1)how can i check in which edge of the brick the ball hit
2)how can i calculate the distance from the center of the paddle to the collision
spot
i want to make an arkanoid game.i want to keep it simple so i dont want to any physics.probably it will be with simple 3d graphics but in 2d motion in general.
i dont have yet wrote i single line.i am planning at the moment.i'd the the help of anyone,if he can,for some question i have
i think the code of the ball's motion will be something like this
it's going to have a X_speed and a Y_speed.the values of x and y i guess wil coming from a simple line function.
you know, if i want the ball to moving in 45o angle, then we'll have
x=a*y -> a=1 -> x=y
when the ball collides with the bricks the motion of the ball will change into this:
collides with the upper or the down edge of the brick -> x*=-1 (x for vertical,y for horizontal)
collides with the left or right edge of the brick -> y*=-1
(if i make mistakes correct me)
if collision occur between ball and paddle then proportionally how far from the center of the paddle were the collision,it will take and a concrete angle of move.
my questions of course are:
1)how can i check in which edge of the brick the ball hit
2)how can i calculate the distance from the center of the paddle to the collision
spot
Re: arkanoid
I suggest you start looking at some code because the things you just mentioned are very simple to do. The collision example is where you should look. :3kalkas wrote:hi
i want to make an arkanoid game.i want to keep it simple so i dont want to any physics.probably it will be with simple 3d graphics but in 2d motion in general.
i dont have yet wrote i single line.i am planning at the moment.i'd the the help of anyone,if he can,for some question i have
i think the code of the ball's motion will be something like this
it's going to have a X_speed and a Y_speed.the values of x and y i guess wil coming from a simple line function.
you know, if i want the ball to moving in 45o angle, then we'll have
x=a*y -> a=1 -> x=y
when the ball collides with the bricks the motion of the ball will change into this:
collides with the upper or the down edge of the brick -> x*=-1 (x for vertical,y for horizontal)
collides with the left or right edge of the brick -> y*=-1
(if i make mistakes correct me)
if collision occur between ball and paddle then proportionally how far from the center of the paddle were the collision,it will take and a concrete angle of move.
my questions of course are:
1)how can i check in which edge of the brick the ball hit
2)how can i calculate the distance from the center of the paddle to the collision
spot
You did see the examples in the SDK? Did you understand them? It should be no problem to do a simple game with that knowledge.
I suggest -> try to create that game and ask specific questions as you discover problems. Before that do the tutorials.
(For bigger games you should NOT just start and see what happens, but thats not the case here)
I suggest -> try to create that game and ask specific questions as you discover problems. Before that do the tutorials.
(For bigger games you should NOT just start and see what happens, but thats not the case here)
ok,if i could kill someone through this forum,that would be Pyritie and geckoman.
you geckoman,did you read my question?did you understand them?
i did read the tuts i did understand them.i know how to do a f*cking collision check.my f*cking question is:
when the ball collides with a brick,how do i know which of the brick's side the ball touch??
and i suppose the most of you in here had played once arkanoid.when the ball collides with the paddle,if the ball touches the very edge of the paddle,reflects and takes different course and if touches the center of the paddle different.
i dont need to write any code.those are my question and i can't continue if i can't answer them.
and i don't want to hear any smartash again say to me to read the tuts.
i you don't know the answer just shut the f*ck up and don't reply you f*cking piece of sh*t[/quote]
you geckoman,did you read my question?did you understand them?
i did read the tuts i did understand them.i know how to do a f*cking collision check.my f*cking question is:
when the ball collides with a brick,how do i know which of the brick's side the ball touch??
and i suppose the most of you in here had played once arkanoid.when the ball collides with the paddle,if the ball touches the very edge of the paddle,reflects and takes different course and if touches the center of the paddle different.
i dont need to write any code.those are my question and i can't continue if i can't answer them.
and i don't want to hear any smartash again say to me to read the tuts.
i you don't know the answer just shut the f*ck up and don't reply you f*cking piece of sh*t[/quote]
yes it's a zoo...
make me laugh though...
man seriously you really get the top position, that would be zoo manager... EDIT3: alternatively you could also be the 'Chimpanzee'
wow, still laughing... From all posts in all 'serious' forums I've ever read in my entire 30 year life, yours definitly is the most (still searching for the right word), well the wrongest of wrong ways to ask a question...
To your problem... I'm not sure if detecting the edge of the paddle mesh or block you hit really helps or just complicates the matter... all you need to check to make the behaviour your suggesting is the distance from the centre of paddle and/or block... but that really wouldn't be relevant either because the only thing that really matters is the angle since:
http://en.wikipedia.org/wiki/Reflection_(physics) <-dont know why the link won't work
EDIT: changing + to - and vice versa will get you quite far, maybe you make a demo with at least that behaviour before attempting to continue with arkanoid typical distorted physics... looking at the triangle selector in the api you should be at least able to get the number (index) of the face you hit
EDIT2:
No thats the law of reflection, but applying it, calculating angles and changing the direction of motion is best done when understanding vector math...
http://www.geocities.com/SiliconValley/2151/math3d.html
http://chortle.ccsu.edu/VectorLessons/vectorIndex.html
make me laugh though...
man seriously you really get the top position, that would be zoo manager... EDIT3: alternatively you could also be the 'Chimpanzee'
wow, still laughing... From all posts in all 'serious' forums I've ever read in my entire 30 year life, yours definitly is the most (still searching for the right word), well the wrongest of wrong ways to ask a question...
To your problem... I'm not sure if detecting the edge of the paddle mesh or block you hit really helps or just complicates the matter... all you need to check to make the behaviour your suggesting is the distance from the centre of paddle and/or block... but that really wouldn't be relevant either because the only thing that really matters is the angle since:
http://en.wikipedia.org/wiki/Reflection_(physics) <-dont know why the link won't work
And like most problems here, again that would be a matter of properly understanding vector math, I suggest some reading, AND anger management...The angle which the incident ray makes with the normal is equal to the angle which the reflected ray makes to the same normal.
EDIT: changing + to - and vice versa will get you quite far, maybe you make a demo with at least that behaviour before attempting to continue with arkanoid typical distorted physics... looking at the triangle selector in the api you should be at least able to get the number (index) of the face you hit
EDIT2:
No thats the law of reflection, but applying it, calculating angles and changing the direction of motion is best done when understanding vector math...
http://www.geocities.com/SiliconValley/2151/math3d.html
http://chortle.ccsu.edu/VectorLessons/vectorIndex.html
Last edited by zillion42 on Wed Feb 18, 2009 1:29 pm, edited 3 times in total.
Thanks zillion I knew it would be something like that, i've been thinking that it might besomething along those lines but I couldent, put my finger on it.
This is vector maths? time for some google-ing.
I think that it is the "(" in the link that the forum dosent like.
Thanks,
Pete
This is vector maths? time for some google-ing.
I think that it is the "(" in the link that the forum dosent like.
Thanks,
Pete
Ein knowledge seeker
