Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help on Helicopter game
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Guest




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Darkmantis




PostPosted: 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.
Guest




PostPosted: Thu May 11, 2006 9:03 am   Post subject: =)

Thanks =D
Darkmantis




PostPosted: Thu May 11, 2006 10:38 am   Post subject: (No subject)

no problem, this was my first time acually helping someone Smile
monkeynamedsteve




PostPosted: 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.
Darkmantis




PostPosted: 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.. Sad but I only had like 2 days to work on it anyway.
MysticVegeta




PostPosted: 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.
do_pete




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
monkeynamedsteve




PostPosted: 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.
do_pete




PostPosted: Thu May 11, 2006 6:11 pm   Post subject: (No subject)

Not really, it would be better to use a 2D array.
monkeynamedsteve




PostPosted: 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.
Guest




PostPosted: Thu May 11, 2006 9:09 pm   Post subject: (No subject)

I can tell your still here.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: