Computer Science Canada Hockey Problem...still |
Author: | @DRI@N [ Mon May 31, 2004 6:32 pm ] | ||
Post subject: | Hockey Problem...still | ||
For god sakes this aint workin ..if I shoot from somewhere on the right side of the screen it goes down...BUT Y always returns positive (get puck and press shift to shoot)
|
Author: | rhomer [ Mon May 31, 2004 6:42 pm ] |
Post subject: | |
Sorry i can;t help...Your code is quite confusing... just a suggestion...use comments so other users will understan whats happenind where easier and what some variables stand for. |
Author: | Tony [ Mon May 31, 2004 6:44 pm ] |
Post subject: | |
i agree with rhomer, code is quite confusing to read. ether way - I think the problem lies in the fact that player doesn't have to be really close to "grab" the puck. This way when you shot, the puck moves one frame but is still within the player's "grab the puck" range and gets pulled back in on the next loop. |
Author: | SuperGenius [ Mon May 31, 2004 7:01 pm ] |
Post subject: | |
while playing your game the puck got outside the arena somwhow. |
Author: | rhomer [ Mon May 31, 2004 7:07 pm ] |
Post subject: | |
ya i noticed that too...if you shoot from the left side at a sharp angle then it will bounce off the top right corner and go out the left side of the rink...very annoying! |
Author: | guruguru [ Mon May 31, 2004 7:16 pm ] | ||
Post subject: | |||
I think Tony's nailed it. As soon as you shoot, you should make a counter that is assigned how far away the puck is. Only when the distance away is greater than... say 50... is the player allowed receive the puck again.
That's the basic outline and order of what should happen. |
Author: | @DRI@N [ Mon May 31, 2004 9:11 pm ] |
Post subject: | |
Believe me I've already tried it with the boolean variable...and its only going back to the stick when the slope is 1 so I need smarter way to shoot. THe problem is that whole trig thing Tony gave me with cosd and sind I dont exactly understand. If I did I could fix it.. |
Author: | Tony [ Mon May 31, 2004 10:35 pm ] |
Post subject: | |
i'm afraid you'd just have to try to make the flags work again the player should be able to pick up the puck only when the boolean variable is marked the right way. And it gets marked only when the puck is out of player's "pick up" range. Once the shot is made, the variable remains false untill is it far away to escape "pick up". another solution would be to increase the strength of puck shot so that it would escape that pickup zone on the first frame (that'd be quite fast unless you lower that distance. |
Author: | @DRI@N [ Tue Jun 01, 2004 6:57 pm ] |
Post subject: | |
Yes fast shots will work.. I plan to make slapshots and wristshots. I'm sure slapshots will work because they are like 10x faster than the wrist. As for wrist do u think I could just set the puck x and ys to the corner of the collision zone and then shoot as opposed to shooting from within it or using if statements for slope. I tried making it go to the stick when slope is less than 2, but on 45 degree angles.... |