Alice Community Which way is the object pointing to

 Which way is the object pointing to
 roofy Guest   Status: Posts: n/a Which way is the object pointing to - 11-04-2006, 11:01 AM Hi there, for my second project, I have created a simplified version of the game horseshoes. As for the code, I gotten as far as letting player1 toss his or her 2 horseshoes, and then give the computer a turn to toss its 2 horseshoes. So now I am ready to calculate both players score, but the problem I am having with is finding if the current horseshore that is being checked for is a ringer or not. The only thing I can come up with is to somehow create some code that checks if the given horseshoe is pointing towards the horseshoe pole. However, I cannot find any prebuilt method or function that can do what I want it to do. So can anyone else think of another way I could do this?
 A Ringer?
DrJim
Guest

Status:
Posts: n/a
A Ringer? - 11-04-2006, 06:26 PM

Haven't seen what you're trying to do but wouldn't a simple distance check work. The origins of both parts would have to be correct but, for the first two I looked at - magic wand and magnet - they were ok. In the picture shown, for example, a simple "magnets distance to wand is less than half the magnet's width'' check would seem like it would work.
Attached Images
 ringer.JPG (4.7 KB, 101 views)

roofy
Guest

Status:
Posts: n/a
11-05-2006, 07:17 AM

The problem with that is you have not checked if the horseshoe is facing the other direction. Here is an example of what I mean that would not be consider as a ringer
Attached Images
 horseshoe example.JPG (5.8 KB, 123 views)

 Darn
DrJim
Guest

Status:
Posts: n/a
Darn - 11-05-2006, 04:57 PM

Think what I suggested "would have worked if" - ah, wonderful words - the center of the magnet object had been where I thought it was instead of where it actually is (darn reality, even the virtual type). Consider instead a torus with the center truly in the middle of the ring. Now the case you show will not count as a ringer since the center of the torus is more than a radius away from the wand (pole).

If you want to actually orient the opening so the horseshoe won't go through the pole when tossed, you do need to do more, of course - or you could just change the name of the game to "Ring Toss."
Attached Images
 ringer_2.JPG (7.2 KB, 95 views)

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge