Computer Science Canada Hockey Game Help |
Author: | @DRI@N [ Sun May 23, 2004 4:25 pm ] | ||
Post subject: | Hockey Game Help | ||
Hey I'm making a hockey game, but I'm having trouble with the scoreboard. You press "enter" to drop the puck and if it is in the box it should be 1:0 but the score is different every time. The corners as well, I don't know how to make the puck and player bounce off them
|
Author: | Tony [ Sun May 23, 2004 5:04 pm ] | ||
Post subject: | |||
see how you have
you add one to the score, but you do not move the puck out of the net. So next time though the loop the puck is still there and scores just keep on adding up. After you count the score, you should move the puck out of the net |
Author: | @DRI@N [ Sun May 23, 2004 5:31 pm ] |
Post subject: | Corners |
Thanks, so I'll just reset the puck x and y coordinates to what they were at the start of the loop. Same with the player, but do you have any ideas about those corners?? |
Author: | Paul [ Sun May 23, 2004 6:55 pm ] | ||
Post subject: | |||
The corners... you can try using whatdotcolor, if you visualize your player as a rectangular picture, figure out the coordinate at the corners of your picture. And if you were pressing the left arrow key, instead just if chars(KEY_LEFT_ARROW), you go
Im sure u can figure it out using the corners. |
Author: | Andy [ Sun May 23, 2004 8:12 pm ] |
Post subject: | |
or you can use some math and just make sure the dot is within the triangle... |
Author: | Paul [ Sun May 23, 2004 8:33 pm ] |
Post subject: | |
Damn it dodge, you gave up whatdotcolor for Hyori Lee! |
Author: | Andy [ Mon May 24, 2004 10:56 am ] |
Post subject: | |
yes im sorry... cant resist... nah i'd never give up whatdotcolor... im just pissed off rite now cuz in c++ whatdotcolor is called getpixel... wtf is wit that??? blah... hes my friend and i told him how to do it already |
Author: | @DRI@N [ Mon May 24, 2004 7:04 pm ] |
Post subject: | |
Now how I am going to make him shoot I tried making a function to calculate slope and assign that value to puckxchange and puckychange but hey what do u know it doesnt work |