Author |
Message |
Guest
|
Posted: Wed May 10, 2006 10:09 pm Post subject: Help on Helicopter game |
|
|
Hey I'm new to these forums. I'm in a Grade 11 Programming Course and we're learning Turing. I seem to have a problem with my Helicopter game I'm working on, when I hold down the mouse and touch the green, the helicopter goes through it.
Im guessing it's a logical bug I cant seem to find, because I reversed and made helicopter go down when I held the mouse and he crashed. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Darkmantis
![](http://compsci.ca/v3/uploads/user_avatars/26883420945d0bc0dc57ea.jpg)
|
Posted: Thu May 11, 2006 8:53 am Post subject: (No subject) |
|
|
I think you should try placing your whatdotcolor code inside the buttonpress code so that it detects while your pressing down the mouse button. |
|
|
|
|
![](images/spacer.gif) |
Guest
|
Posted: Thu May 11, 2006 9:03 am Post subject: =) |
|
|
Thanks =D |
|
|
|
|
![](images/spacer.gif) |
Darkmantis
![](http://compsci.ca/v3/uploads/user_avatars/26883420945d0bc0dc57ea.jpg)
|
Posted: Thu May 11, 2006 10:38 am Post subject: (No subject) |
|
|
no problem, this was my first time acually helping someone ![Smile Smile](http://compsci.ca/v3/images/smiles/icon_smile.gif) |
|
|
|
|
![](images/spacer.gif) |
monkeynamedsteve
![](http://i2.tinypic.com/xprplw.jpg)
|
Posted: Thu May 11, 2006 1:55 pm Post subject: (No subject) |
|
|
Just a tip, when you use the whatdotcolour code, make sure to make the pixels it locates the corners of the helicopter picture. If you make it the middle of the picture, it won't be as effecient. I learned this trying to work on my Pacman program. |
|
|
|
|
![](images/spacer.gif) |
Darkmantis
![](http://compsci.ca/v3/uploads/user_avatars/26883420945d0bc0dc57ea.jpg)
|
Posted: Thu May 11, 2006 5:20 pm Post subject: (No subject) |
|
|
ya for my pac man game I had to use 4 points too, but my pac-man still managed to eat the wall.. but I only had like 2 days to work on it anyway. |
|
|
|
|
![](images/spacer.gif) |
MysticVegeta
![](http://www.geocities.com/ohsoinsane/my_avatar.JPG)
|
Posted: Thu May 11, 2006 5:53 pm Post subject: (No subject) |
|
|
you could also use random green boxes making a level with patterns but thats upto you.
Also, 1 more alternative to the whatdotcolor is the Math.Distance formula, if you plan to make the green boxes on turing rather than images, then Math.Distance would be a better approach, its basically a simple distance function in a Cartesian plane. |
|
|
|
|
![](images/spacer.gif) |
do_pete
![](http://i38.photobucket.com/albums/e112/do_pete/1943.gif)
|
Posted: Thu May 11, 2006 6:06 pm Post subject: (No subject) |
|
|
Also Math.DistancePointLine is useful when dealing with line segments when getting to more complex shapes. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
monkeynamedsteve
![](http://i2.tinypic.com/xprplw.jpg)
|
Posted: Thu May 11, 2006 6:08 pm Post subject: (No subject) |
|
|
Do you guys think that those math functions would be any help in Pacman. Sorry to leech off this thread. |
|
|
|
|
![](images/spacer.gif) |
do_pete
![](http://i38.photobucket.com/albums/e112/do_pete/1943.gif)
|
Posted: Thu May 11, 2006 6:11 pm Post subject: (No subject) |
|
|
Not really, it would be better to use a 2D array. |
|
|
|
|
![](images/spacer.gif) |
monkeynamedsteve
![](http://i2.tinypic.com/xprplw.jpg)
|
Posted: Thu May 11, 2006 6:14 pm Post subject: (No subject) |
|
|
Alright, thanks.
And now back to The Helicopter program.
Pretend I was never here. |
|
|
|
|
![](images/spacer.gif) |
Guest
|
Posted: Thu May 11, 2006 9:09 pm Post subject: (No subject) |
|
|
I can tell your still here. |
|
|
|
|
![](images/spacer.gif) |
|