Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How do I use the "___ is within ____ meters" function for object boundaries?
Old
tango217
Member
 
tango217's Avatar
 
Status: Offline
Posts: 48
Join Date: Feb 2010
Question How do I use the "___ is within ____ meters" function for object boundaries? - 02-24-2010, 06:23 PM

Hi,
Im trying to find a function similar to "____ is within ____ meters" but instead of the distance being measured from the center origin of the object, I want the distance to be measured from the objects physical boundaries. Like in an if/else statement: "If [ball] is within [.5] meters to the left of square, do ____". maybe not that exact wording but something that will give me that result. I tried doing the function "____'s distance to the left of ____" but that didn't seem to work for some reason :/. I'm currently working on a 2 player 3d "pong" program that I think is quite close to the original. I just need to work this little issue out and it will be almost complete.
   
Reply With Quote
Old
tango217
Member
 
tango217's Avatar
 
Status: Offline
Posts: 48
Join Date: Feb 2010
Smile 02-24-2010, 06:55 PM

just kidding, i just found out how lol
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 02-24-2010, 06:59 PM

When you are done could you post it to the forums? I would like to play it


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
tango217
Member
 
tango217's Avatar
 
Status: Offline
Posts: 48
Join Date: Feb 2010
Default 02-24-2010, 10:50 PM

I will post it as soon as I'm finished. Which should be rather soon. Just fine tuning some things and adding some spice to it.
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 02-25-2010, 08:29 AM

Quote:
Originally Posted by tango217 View Post
just kidding, i just found out how lol

Great


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Sounds good
Old
King Gamer(gorit)
Guest
 
Status:
Posts: n/a
Default Sounds good - 02-25-2010, 03:59 PM

Ok, cool that sounds fun. Oh, and thanks for posting this because it reminded me that my collision detection engine only works wth the camera.
   
Reply With Quote
Old
tango217
Member
 
tango217's Avatar
 
Status: Offline
Posts: 48
Join Date: Feb 2010
Cool 02-25-2010, 05:24 PM

I just finished the "frame" of the pong game. The basics off the game are there, but at the moment i'm fine tuning it. For example if the paddle is moving downwards, and if the ball is moving downwards and they collide, the angle steepens and the ball speed increases. Stuff like that. should be really cool.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 02-25-2010, 05:30 PM

Also, if you haven't already, it would be good if there was a stopper on how far up and down you can go with the paddle so that you do not go off the screen.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Ooh.. you could help me.
Old
SammehDx
Guest
 
Status:
Posts: n/a
Red face Ooh.. you could help me. - 02-26-2010, 12:07 PM

Quote:
Originally Posted by tango217 View Post
just kidding, i just found out how lol
Could you please post how you did it? I am having serious issues with something similar and I would really appreciate any way you could help me.
   
Reply With Quote
Old
tango217
Member
 
tango217's Avatar
 
Status: Offline
Posts: 48
Join Date: Feb 2010
Smile 02-26-2010, 05:13 PM

Quote:
Originally Posted by SammehDx View Post
Could you please post how you did it? I am having serious issues with something similar and I would really appreciate any way you could help me.
I made world variable named ballDistanceBelowWall. Then i made in an event called "While the world is running do...." and in the "during" i put a method that says to "set the value of ballDistanceBelowWall to ball distance below wall" and since this value is constantly being calculated by the "while the world is running" event, i can then make another method saying, "if ballDistanceBelowWall <= 0 (or whatever number works), then do ...." which in my case would be running the angular launch equation after the ball hits the wall. i hope this isnt too confusing :/. but im releasing my pong game rather soon that has all this in there so you could look at that when it comes out.
   
Reply With Quote
Reply

Tags
boundaries., distance, game, pong, tango217

Thread Tools
Display Modes

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 Jump



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