Alice Community  

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

Reply
 
Thread Tools Display Modes
trouble with jumping
Old
TheAngryAlterEgo
Guest
 
Status:
Posts: n/a
Default trouble with jumping - 09-19-2006, 06:34 PM

I'm working on recreating the first level of Super Mario Bros. for class, but I'm having a problem with him jumping on enemies. I can get him to jump on them, but when he lands the enemy doesn't perform the method for dying. In this case, [enemy] is a parameter being used as a Mushroom

Here's what I have coded:
If {both[Mario] is above [enemy]} and {[Mario] is within [.1 meters] of [enemy]}
{[enemy] move down [5 meters]}
Else
{Do Nothing}

Does anyone know what's wrong with this code or the right code to use to make the enemy sink into the ground when it is jumped on?
   
Reply With Quote
Old
gabe
Administrator
 
gabe's Avatar
 
Status: Offline
Posts: 461
Join Date: Jul 2005
Location: Pittsburgh, PA
Default 09-21-2006, 11:27 AM

Try changing the "above [enemy]" to "above [enemy subpart]". Alice does not consider object1 to be above object2 once it passes below object 2's highest subpart (I believe). So it's possible that both of your cases will never be true. You need to play around with the values to find what works best. You'll probably also want to change the "within .1 meters" to something a little larger to get this to work.
   
Reply With Quote
Old
beachbum111111
Senior Member
 
beachbum111111's Avatar
 
Status: Offline
Posts: 852
Join Date: Feb 2010
Location: e
Default 10-25-2010, 02:49 PM

even though they say alice isn't complicated it really is...
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 10-25-2010, 03:20 PM

Quote:
Originally Posted by beachbum111111 View Post
even though they say alice isn't complicated it really is...
Trust me though, this is nothing compared to the written programming languages like C#, try making a game using that.


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
Akira101
Guest
 
Status:
Posts: n/a
Default 10-25-2010, 03:53 PM

Quote:
Originally Posted by Dameria View Post
Trust me though, this is nothing compared to the written programming languages like C#, try making a game using that.
Damn, C++ for me is complicated enough, I can't do much with it, random number generator, prime numbers, and a couple other things is what i can do with C++ from a book, but probably gonna learn LUA Scripting instead since I would like to try it and i play garry's mod alot and the game is practically revolving around lua scripting so its a good since i can test and use it for in-game stuff to make it more fun.
   
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 ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.