Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   need help please... (http://www.alice.org/community/showthread.php?t=3769)

xxx 01-13-2010 08:20 PM

need help please...
 
i want to make a game where the every time a person is pressed, the person turns invisible and when the mouse is clicked on an animal its size its reduced. i know how to do it separately for each object but is there some way i can make the method for one person for everybody else? i think it had something to do with a variable or a parameter or am i completely off the mark?

Dameria 01-13-2010 08:48 PM

You would need to make a method where you do "When mouse is clicked on..." and then for the object leave it on "everything", but for the action, make a separate method and make an object parameter (make sure you click the "object" bubble when making the parameter). Then in the "do..." place of the event, put in the method you just made, and for the parameter you go down to "expressions" and then "object under mouse cursor". Then in the actual method, put multiple if/else statements. This is where you list all of the things you want to change.

[b]You can use the parameter at the top of your method as a variable, just drop it down to where you want it to go in your code[/b]
For example, if you want it to be when you click a person he turns invisible, you make an if/else in the method that says "if (parameter) == person, then make person opacity = 0", or something like that. And then if you want a certain object to get bigger when clicked on, you make an if/else "if (parameter) == otherObject, then make otherObject resize 1/2". You can make as many if/else statements for as many objects as you want in this method, while only having one event to call on them.

If you still do not understand, I will make an example world for you to see. If you do understand please tell me.

xxx 01-13-2010 08:58 PM

i sort of understand but i would appreciate if you show me an example world. i really appreciate all the help. thank you!!

Dameria 01-13-2010 09:15 PM

1 Attachment(s)
ok heres an example world, please tell me if you still do not understand how I did a certain thing:

xxx 01-13-2010 09:55 PM

how did u put objectsclickedon==bunny? i got to tat part but i can select my objects on the second drop down menu. it only gives me numbers and the expression.

Dameria 01-13-2010 10:16 PM

the objectsClickedOn is the parameter at the top of the method, you just drop it down from there, and then you do == and then pick a number (lets say 1). But then you drag an object from the object list on the left and drop it in where it says 1, so instead of objectsClickedOn == 1, it would be objectsClickedOn == bunny.

xxx 01-13-2010 10:27 PM

when i drag down the object i get a drop down menu i have never seen before tat said something like bikekid2 opacity and the other option is bikekid 2 specular highlight exponent.

dubastot 01-13-2010 10:47 PM

I think what Dameria is saying you should drag the cvariabel down to your methods window and select the == sign.

xxx 01-13-2010 10:54 PM

tat is what i did and i got those 2 options.

xxx 01-14-2010 05:21 PM

is there a way that while your video is playing that the objects can be deleted?like not turn invisible but outright deleted? thx a bunch!


All times are GMT -5. The time now is 02:06 PM.

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