Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   trying to make a game (http://www.alice.org/community/showthread.php?t=12042)

aprils1293 07-11-2018 09:26 PM

trying to make a game
 
1 Attachment(s)
Hello guys,
Im trying to make a game called puttbull (similar to golf ) so wherever the ground is clicked on the baseball will go in that direction to go to the closest hole and then you score a certain amount of points.I have the timer made but I'm lost on how to make it actually work.Please help me if you can! thanks

chickentree 07-12-2018 05:58 PM

1 Attachment(s)
[QUOTE=aprils1293;58129]Hello guys,
Im trying to make a game called puttbull (similar to golf ) so wherever the ground is clicked on the baseball will go in that direction to go to the closest hole and then you score a certain amount of points.I have the timer made but I'm lost on how to make it actually work.Please help me if you can! thanks[/QUOTE]

You need to do a few things for this:[LIST=1][*]Let the user determine which direction to hit the ball.[*]Move in the desired direction some random amount. This assumes the user doesn't always get a whole in one.[*]Test if the ball ended up in the hole.[/LIST]I added a method to do this for the 3rd hole and an event that calls it if the 'S' key is pressed. You would need to do something similar for the other holes.

Mark


All times are GMT -5. The time now is 08:28 PM.

Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.