Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Little help (new here...)

Author
Message
Xantus
19
Years of Service
User Offline
Joined: 9th Aug 2006
Location:
Posted: 9th Aug 2006 17:59
Well ive started with few tutorials, made some simple thing and wanted to make break out style game... Ive downloaded break out engine from code base, but i cant get it work good....

My problem is: ball move

at start of the game it should move up....till first collision...

Code of this :



when i add dec ball_y it of course go up....but never stops even at collision etc... How to make this right ?

Its prabably easy....but im new at this...
Xantus
19
Years of Service
User Offline
Joined: 9th Aug 2006
Location:
Posted: 9th Aug 2006 19:49
Since i cant edit (Unknown System Error appears).

I manage to get it working.

But the collision system is kinda wierd when i hit block from bottom its ok , but when ball comes from the top of the screen there is no collision - ball just go throu blocks from top like throu air no Y movement change etc...

Beside that how can i make its more precise (collision system) not just "when collision ball_y = -1" but something like angle of dropping ball when collision = ball new move = - angle of dropping, accurate one like in good break out games.

Sorry for my bad english, im from pl
Matt Rock
21
Years of Service
User Offline
Joined: 5th Mar 2005
Location: Binghamton NY USA
Posted: 11th Aug 2006 19:24
This belongs in one of the programming sections. A mod will probably end up moving it, so don't be surprised if it vanishes... it just means it was moved Also, you shouldn't double-post. Use the "edit" button in the forums if you forgot to mention something. I see that you tried to use edit, but some people assume the feature doesn't work and they keep double-posting after the issue is fixed. Anyway, just a few friendly bits of advice You're new so I'm trying to keep others from flaming ya hehe.

Try playing around with variables and experiment with the code. Add to it, subtract from it, etc. Try to figure out why certain variables make certain things happen.


"In an interstellar burst, I'm back to save the universe"
Zergei
21
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 11th Aug 2006 23:56 Edited at: 11th Aug 2006 23:58
I found the answer to your problem... or so i think, but it must be this...

check the following...


Notice that you set the borders for where the ball should collide... well, if you see a bit better, you'll see that the last "if" statement checks for "ball_y" when it should do for "ball_x".

Also here...


Same here but viceversa, you are checking for "ballx_dir" where you should check for "bally_dir", same place, on the last "if" statement.

So basically, just change it to like this


Further on my stuff at...

Login to post a reply

Server time is: 2026-07-05 23:07:08
Your offset time is: 2026-07-05 23:07:08