Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   How do I add levels to a game program? (http://www.alice.org/community/showthread.php?t=7886)

caitlindlc 01-06-2012 11:52 AM

How do I add levels to a game program?
 
1 Attachment(s)
My game is called Eat the Hay. In the game, the user controls a cow that moves to bales of hay to "eat" it. (The bales actually just disappear when the cow is near enough). This is for a school project, but I have to make this game more difficult. I wanted to add two levels and make each level progressively harder. However, I have no idea how to even add levels and how to go about it. I've attached the game, but I really need help!

GameKid 01-06-2012 09:35 PM

Add a rally where the cow starts, and multiple invisible hays with booleans. Make it so that when the cow eats all the current hays, he moves back to the rally, and the invisible hays appear and set the boolean to true. Also make it so that the cow will only eat the hay if the booleans are true.
Build off of that setup. Private message me if you need more guidance.

jwags 01-12-2012 10:14 PM

exactley what he said but in english ---/\


open a blank map. go really far left facing one way, add opject then click the tab that says "more controls" then click "drop dummy object at camera", now go backwards a lot and turn the opposite way (should face away). and drop a camera dummy object here.

now move camera to the first dummy object (right click camera -> click "move to" -> select "dummy object 1" (might be in a folder))

now build your seen one. then do the same thing near "dummy object 2" but harder i guess.

now loop infinity times a world level method in the main method. Now create a world level function and make an if statement in there, and drag a world level function in that says "both a and b". and drag it into b multiple times till you have enough for all the object of hay in the first level. then drag an "==" in each value. and make it equal to "false". then drag each hay properties "is showing" in the values of a and b all the way through till there are no more hay bales left uncalled and no values left. (should be "both [hay1] [isShowing] == [false] and hay2...")
[COLOR="Red"](only do the bales that are for level 1) and make sue the functioni s a boolean[/COLOR]

then return true in the first "do nothing" then return false in the "else". then call the function in the method u made be4 in an if statement. and then move camera and guy to camera dummy object 2 from be4. duration of 0. and yea u got the point

caitlindlc 01-17-2012 11:51 AM

So basically i've reworded a section of what you said into a step by step list:

[INDENT]1. loop infinity times a world level method in the main method

2. create a world level function and make an if statement in there

3. drag a world level function that says "both a and b"

4. drag it into b multiple times till you have enough for all the object of hay in the first level

5. drag an "==" in each value. and make it equal to false

6. drag each hay properties "is showing" in the values of a and b all the way through till there are no more hay bales left uncalled and novalues left
(should be "both [hay1] [isShowing] == [false and hay2...")

7. then return true in the first "do nothing" then return false in the "else."

8. call the function in the method you made before in an "if statement"

9. move the camera and guy to camera dummy object 2 from before, duration of 0
[/INDENT]

But I don't understand step 4. Drag [I]what[/I] into b? I might have more questions as I progress through this project. Thank you so much for all of your help!!

dakota95 01-17-2012 12:33 PM

the way that I would do this is, and I know there are better ways. But I'd make another "ground" and move it up 1000meters and make it so that if the cow eats all of the hay in the lower world' then move up to a dummy object in upper world

caitlindlc 01-17-2012 06:39 PM

@dakota95 that sounds like a good idea. But how would I go about making the game program automatically advance to the 2nd level dummy after the hay bales in level one have disappeared?

dakota95 01-18-2012 07:00 PM

do you know how to use if/else statements?

the way you do it is by placing a lot of them inside of each other. Say, if bale1 is showing false, then, if bale2 is showing false, then, if bale three is showing false etc.... Then to dummy object.

caitlindlc 01-30-2012 08:52 AM

How do I make it (the part that I have circled in red) false, though?This is what I have so far. (PS Please reply soon!)

[IMG]http://i39.tinypic.com/osxtsj.jpg[/IMG]

Mr Kidnapper 01-30-2012 08:58 AM

What you try to do in that part is check IF it's false. You can do that by taking the whole thing, going to ==, and clicking on "false".

Looks like you don't explicitly need to make anything false for this to work, assuming that when you eat hay, it turns the isShowing variable false. To do that, go to your Eat Hay method and drag the isShowing variable from the object's parameters and make it false.

caitlindlc 01-30-2012 09:26 AM

1 Attachment(s)
I'm having a little trouble understanding what to do. I'm really desperate to get this project finished since it's due soon. I'm not asking you to do my project (unless you'd like to, by all means, go ahead!:)) But, please just point out what's wrong in my programming and what I should do to make the camera move to the "level 2" dummy object, which is how I planned to advance to level 2 after the user has made all the hay bales in level one disappear. Thank you very much!!!


All times are GMT -5. The time now is 06:42 AM.

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