Alice Community  

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

Reply
 
Thread Tools Display Modes
A little help with If/Else please?
Old
savyxox
Guest
 
Status:
Posts: n/a
Default A little help with If/Else please? - 10-12-2009, 10:54 AM

I'm making a game, where there's this giant squirrel and it's destroying all these buildings.
So far I've made Walk, Jump, Kick and Punch methods.
I need help with the If/Else statements though.
What I want is, that when the Squirrel, let's say Kicks, a certain building, it'll resize.
Thanks
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 10-12-2009, 02:25 PM

Try this:

do together
squirrel.kick
if Squirrel is within (buildingWidth) of building and nuilding is in front if squirrel
building re-size .1

This will mkae it so that if the squirrel is relatively close to the building and the squirrel is generally facing the building, it'll re-size.
   
Reply With Quote
Reply

Tags
game, if/else

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 ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.