Computer Science Canada BLOCKSIES GAME!!! please check it out!!! |
Author: | Amreen [ Wed Jan 12, 2005 9:10 am ] | ||
Post subject: | BLOCKSIES GAME!!! please check it out!!! | ||
Hey Everyone!! listen, im creating a blocksies game and all it is, is the replica of PONG...the object of this game is to move the blocker at the bottom of the screen and make sure it catches the asterisks as they fall from random places on the screen. I want to make the asterisks bounce off the blocker at the bottom of the screen. Please help me out and post ur comments, advice and insturctions on how i can make my program work right. I really do appreciate it and hope that this program is a success. THANX for all who do post!!!!
|
Author: | Delos [ Wed Jan 12, 2005 1:17 pm ] | ||||
Post subject: | |||||
1)
is a valid identifier. Check out the help file for more details on such terms. 2) You're code seems reasonable enough to be upraded a tad...instead of using getch() for your movement, check out what Input.KeyDown() can do for you. 3) As for the bounces... I suggest that you create a variable that controls the way your change rows...for example, if the * is falling, then its value would be -1, -2, etc...that means that each loop you go through, the row has (-1) or (-2) added to it. Simple algebra, the resultant number is less than that before it.
See what I mean? Now, once it reaches the bottom of the screen, you can simply change the value of your 'delta' variable to a positive number, so now it will intepret the values as increasing... It all comes down to thinking of the movement in terms of vectors. BTW, here's that link from the code in case you're too lazy to cut and paste (like most of us here ) |
Author: | benQ [ Thu Jan 13, 2005 8:53 am ] |
Post subject: | Actually.. |
I tried that because i'm doing the same thing. And it doesn't bounce. Why are you using a counter? |
Author: | Delos [ Thu Jan 13, 2005 9:04 am ] |
Post subject: | |
The counter in this case would be used in conjunction with the locate()s. It would basically store which row the * is currently on. |
Author: | benQ [ Thu Jan 13, 2005 4:05 pm ] |
Post subject: | Oh |
But why doesn't the asterisk bounce? Where should I be putting your code in my program? |
Author: | Cervantes [ Fri Jan 14, 2005 5:34 pm ] |
Post subject: | Re: Oh |
benQ wrote: Where should I be putting your code in my program?
You don't. That's called plagerism. Instead, study his code and the things he said that went with it, then rearrange and warp the code to suit your specific code and your specific problem. |
Author: | Amreen [ Tue Jan 18, 2005 9:08 am ] |
Post subject: | |
ITS NOT PLAGERISM....ITS CALLED I NEED HELP!!!!! |