Computer Science Canada Small Glitches |
Author: | jayman [ Sat Apr 28, 2007 10:50 am ] |
Post subject: | Small Glitches |
OKAY...sorry about asking for to much previously. I created my box with my ball bouncing inside of it..i tried researching mousewhere..i managed to get a paddle going ..still a couple of glitches.. would like assistance in making my ball ..."O".... bounce of this paddle that im controlling with my mouse inside of the box...help/point me in some direction please! -thanks |
Author: | chrisbrown [ Sat Apr 28, 2007 6:41 pm ] |
Post subject: | RE:Small Glitches |
good for you for taking the initiative, but just so you will thoroughly hate me, for future reference, post in the thread you already started when asking for help on the same topic. As well, if you could put what you have done so far into code tags, ie: [*Code*]Code here[*/Code*] except without the *s. Serach the tutorial section for Collision Detection. I'd link, but I'm too lazy right now. |
Author: | jayman [ Mon Apr 30, 2007 10:54 am ] | ||
Post subject: | Re: Small Glitches What i HAVE SO FAR | ||
HERE IS MY CODE SO FAR
|
Author: | Drakain Zeil [ Mon Apr 30, 2007 4:17 pm ] |
Post subject: | RE:Small Glitches |
I can't tell by looking at your code what that last endif is for. press f2 and line it up. Here is your code, but what are you asking? |
Author: | jayman [ Mon Apr 30, 2007 7:32 pm ] |
Post subject: | Re: Small Glitches |
ah something is still wrong with it..the paddle should be moving at the control of the mouse and whenever it 'hits' the ball the ball just changes direction..nothing else needed |
Author: | chrisbrown [ Tue May 01, 2007 4:46 pm ] |
Post subject: | RE:Small Glitches |
You've made a lot of trouble for yourself by trying to combine text and screen coordinates. When you use locatexy, you are using text-based rows and columns. Graphics commands like Draw.Line use pixel coordinates. What you need to do is use Draw.Oval instead of "O" or get really advanced with div and mod. I'd suggest the first. As well, if you remove the second loop inside the first, and remove if b = 1 and the end if that goes with it, you will see the paddle follow the mouse. |
Author: | jayman [ Wed May 02, 2007 11:17 am ] |
Post subject: | Re: Small Glitches |
THANKS FOR THE HELP SO FAR..VERY APPRECIATED.. so the paddle finally follows the ball.. having som difficulties understanding concept of making the ball appear to bounce with Draw.Oval... |
Author: | chrisbrown [ Wed May 02, 2007 9:10 pm ] |
Post subject: | RE:Small Glitches |
Good stuff so far. What you want to do is check if the ball's coordinates are close to the paddle's (if abs(ballx - paddlex) < 5) or something to that effect, then reverse the travel of the ball. It's the same concept as checking for wall collision. |
Author: | jayman [ Mon May 07, 2007 11:24 am ] |
Post subject: | Re: Small Glitches |
OK new addition..i got my game working...now i would like the paddle to be controlled by the keyboard....any directions? |
Author: | program_x [ Mon May 07, 2007 1:22 pm ] | ||
Post subject: | Re: Small Glitches | ||
uh... maybe... i think something like....
dont exactly quote me on this, as i am pretty sure this is how its worded, but im sorry if its not... |
Author: | richcash [ Mon May 07, 2007 1:27 pm ] |
Post subject: | Re: Small Glitches |
@program_x: you forgot the Input.Keydown(ch). It should go in the loop before the if statements. |