Page 1 of 1

physical response setting

PostPosted: Mon Dec 20, 2010 5:46 pm
by Nykos
Hey everyone, I'm making an arkanoid like game. I used physical response to make the ball bounce on bricks and walls.
Everything worked fine until I added the brick actors( they are al clones of the first brick but with diferent graphics for each one of them) and now the ball acts really weird. It slows down at some moments, accelerates then slows again depending of the brick it collide.

Another thing is that sometimes it doesn't bounce and continues it's way on the same direction, and so it breaks all the bricks on this trajectory.

I've tried various things to set up physical response's multipliers and all, but if I manage to stop the ball from breaking everything on it's way without bouncing, then it slows down.

Could someone be nice enough to explain me how to set up mass, final velocity multiplier please, or maybe it would be best to do some coding.

Thanks in advance, Nykos

Re: physical response setting

PostPosted: Mon Dec 20, 2010 6:00 pm
by Imperialjester
i had this problem before too, instead of cloning the actor, draw the tiles. click on the actor then click tile then select what tile you want to draw the press esc when your done.

Re: physical response setting

PostPosted: Mon Dec 20, 2010 8:23 pm
by zxcvbnm
In the game demo's section I made a Pong game. The best I can say is to download it and look at the code. The author is Krenisis(me) and I did the code simple . If you have any more questions just ask.

Re: physical response setting

PostPosted: Mon Dec 20, 2010 10:36 pm
by Nykos
thank you two,
Krenisis, I hope I found the right pong (viewtopic.php?f=6&t=8446&start=0)
I looked at the code and if I'm not wrong, you used physical response only for collision with the borders of the view, and different scripts for collision with the different paddles.
So first, Why didn't you use physical response on everything, is it to avoid those bugs I've been experiencing?
Then why do your paddles have two actors (like enemypaddle and enemyleft)
And finally could you explain those scripts with yvelocity and xvelocity, is it just an acceleration or does it change the direction the ball goes? And how did you set it up( +9,-14,etc...)
Thanks for helping me

Nykos

Re: physical response setting

PostPosted: Mon Dec 20, 2010 11:21 pm
by zxcvbnm
Ok

1) Yes I used scripts to avoid the ball slowdown bug that occurs after a while in game editor

2) I used diferent scripts for the paddle too. I wanted the game to be realistic as possible. I would say if you play the game, it feels like your playing a real person.

3) Now for your main paddle you need to have 2 or 3 separate actors and parent them to each other. Let me explain for your main paddle the one you control , make 2 actors and label them
leftsidepaddle
rightsidepaddle

A)Now program the ball so if it hit left or right side of paddle it reacts properly ,using my code as a guide. Now program the leftsidepaddle same way I programmed mine. Program the right side paddle same way I did mine. This is a way of perfecting the ball movement so if it hits the right side of paddle the ball will go one way. If it hit left side it goes another way. This is much harder but will make your game that much rewarding and proffessional .

Most of all please take your time and dont rush. I used to rush and my games didnt come out properly. Take your time and your game will be mega fun!!!!! You probaly wonder wow I made this game and be hooked on your own game.

Re: physical response setting

PostPosted: Tue Dec 21, 2010 5:04 am
by Nykos
Wow, thank you so much for taking the time to help me Krenisis, that's cool.
I'll try it today