Alice Community  

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

Reply
 
Thread Tools Display Modes
fixing a barrier
Old
TheAngryAlterEgo
Guest
 
Status:
Posts: n/a
Default fixing a barrier - 10-03-2006, 07:40 PM

I'm working on a game for a final project and I need to stop the player from moving through buildings and other items. I tested a working code that makes the player move away from an object when he gets too close in a new world and got it to work, but when I added the code to my game, the player moves either below the ground or above the objects when he gets near them.
The only difference between the codes is that in the new world I had the player moving at a certain speed while in the game he moves forward 1 meter at a time while the legs move to make the walking realistic. This doesn't seem to make a difference either way however.


This method is brought into another method where it is copied for every object on the screen and put into a Do Together.

This is the walking command for the player.

I tried replacing the current walk method with a Move at Speed method with no success. Is there any other way this problem can be fixed?
   
Reply With Quote
Old
Mr Nemo
Guest
 
Status:
Posts: n/a
Default 10-03-2006, 08:49 PM

Currently, I myself am still trying to perfect collisions. MY best suggestion for you is to run a search on the forum for collisions, and see if you can't find anything useful.
   
Reply With Quote
Old
TheAngryAlterEgo
Guest
 
Status:
Posts: n/a
Default 10-03-2006, 10:00 PM

I've already gone through the forum and haven't found anything that would work in this scenario unfortunatly.
   
Reply With Quote
Old
Mr Nemo
Guest
 
Status:
Posts: n/a
Default 10-03-2006, 10:07 PM

Then you might want to place an if else statement at the beginning of your method. Kinda like this:
IF [(Arbalest) is within (distance) meters of (Object)]
(Arbalest) turn (left) (.5) revolutions
ELSE
(Arbalest.run)
   
Reply With Quote
Maybe the object moved with respect to the world?
Old
DrJim
Guest
 
Status:
Posts: n/a
Default Maybe the object moved with respect to the world? - 10-04-2006, 03:01 PM

I've never tried the "move away" coupled with "as seen by world" but the line of movement is going to be along a line from the center of the object to the center of the world - can't tell where that is, or if it changed, without looking at your worlds.

Try changing the "as seen by" to the object actually moving and see if that helps.
   
Reply With Quote
Reply

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.