Alice Community  

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

Reply
 
Thread Tools Display Modes
School Project Help Please!
Old
meezcat
Junior Member
 
Status: Offline
Posts: 3
Join Date: Mar 2013
Question School Project Help Please! - 03-20-2013, 12:53 PM

For my class, I get to design a Alice program of my choice. I am making a western town with a buffalo walking around. I have the buffalo being moved by the "Let the arrow keys move ____" command. I want to make is so the buffalo can't walk inside of buildings, but I have no idea how to. I've tried using commands like "If buffalo is within 2 meters of salloon move buffalo 10 meters backwards" but they don't work. Does any one have any ideas?
   
Reply With Quote
Old
johngflynn657
Junior Member
 
Status: Offline
Posts: 1
Join Date: Mar 2013
Location: Denmark
Default 03-20-2013, 12:57 PM

We will wait for their answers. I wish i could help.
   
Reply With Quote
Old
fourbros
Senior Member
 
fourbros's Avatar
 
Status: Offline
Posts: 476
Join Date: Nov 2011
Location: Right Behind You...
Default 03-20-2013, 01:35 PM

Quote:
Originally Posted by meezcat View Post
For my class, I get to design a Alice program of my choice. I am making a western town with a buffalo walking around. I have the buffalo being moved by the "Let the arrow keys move ____" command. I want to make is so the buffalo can't walk inside of buildings, but I have no idea how to. I've tried using commands like "If buffalo is within 2 meters of salloon move buffalo 10 meters backwards" but they don't work. Does any one have any ideas?
hmmm... Well try doing what I'm doing for my pokemon game. I would use cubes for collision detection. It would be in a method that would be 'while the world is running'. Here's the pokemon game to show you what I mean. Move with the arrow keys. Tell me if this works. (and if you like the pokemon game, even though it's 99% unfinished)
Attached Files
File Type: a2w Kanto Region Game.a2w (5.05 MB, 22 views)


My avatar is from the anime "Hyouka".......

You've probably never seen it, much less heard of it.....

You should watch it........


print("Hello World")
This is python code.

Lakers > Clippers
Vikings > Packers
Cardinals > Brewers/Pirates/Cubs/Reds
   
Reply With Quote
Old
meezcat
Junior Member
 
Status: Offline
Posts: 3
Join Date: Mar 2013
Default 03-20-2013, 03:01 PM

Thanks for your response fourbros! Your game is very impressive so far! I tried what you used for the hit detection, but it won't work on mine for some reason. I think I coded it properly, and logically it all makes sense, but for some reason it will not register that the buffalo is comming in contact with the box.
   
Reply With Quote
Old
fourbros
Senior Member
 
fourbros's Avatar
 
Status: Offline
Posts: 476
Join Date: Nov 2011
Location: Right Behind You...
Default 03-20-2013, 05:01 PM

I resized the cubes for my game. You may have to change the 'distance from the cube' to fit your game.


My avatar is from the anime "Hyouka".......

You've probably never seen it, much less heard of it.....

You should watch it........


print("Hello World")
This is python code.

Lakers > Clippers
Vikings > Packers
Cardinals > Brewers/Pirates/Cubs/Reds
   
Reply With Quote
Old
meezcat
Junior Member
 
Status: Offline
Posts: 3
Join Date: Mar 2013
Default 03-21-2013, 03:22 PM

I got it to work! I was using the distance between the object's centers rather than their depth's. Thank you for your help!
   
Reply With Quote
Old
fourbros
Senior Member
 
fourbros's Avatar
 
Status: Offline
Posts: 476
Join Date: Nov 2011
Location: Right Behind You...
Default 03-21-2013, 03:24 PM

I'm glad my advice semi-worked for once.


My avatar is from the anime "Hyouka".......

You've probably never seen it, much less heard of it.....

You should watch it........


print("Hello World")
This is python code.

Lakers > Clippers
Vikings > Packers
Cardinals > Brewers/Pirates/Cubs/Reds
   
Reply With Quote
Old
rihanaeg
Junior Member
 
Status: Offline
Posts: 2
Join Date: Apr 2013
Location: egypt
Default 04-29-2013, 03:40 PM

Quote:
Originally Posted by fourbros View Post
hmmm... Well try doing what I'm doing for my pokemon game. I would use cubes for collision detection. It would be in a method that would be 'while the world is running'. Here's the pokemon game to show you what I mean. Move with the arrow keys. Tell me if this works. (and if you like the pokemon game, even though it's 99% unfinished)
thanks for help

Last edited by x2495iiii; 04-29-2013 at 07:20 PM.
  Send a message via Yahoo to rihanaeg  
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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.