Alice Community  

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

Reply
 
Thread Tools Display Modes
How do I add levels to a game program?
Old
caitlindlc
Junior Member
 
Status: Offline
Posts: 5
Join Date: Jan 2012
Default How do I add levels to a game program? - 01-06-2012, 11:52 AM

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!
Attached Files
File Type: a2w eat the hay.a2w (3.69 MB, 3 views)
   
Reply With Quote
Old
GameKid
Senior Member
 
GameKid's Avatar
 
Status: Offline
Posts: 467
Join Date: May 2011
Location: My magnificent castle
Default 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.


[COLOR=e4eaf2]Your text here[/COLOR]
Come on, you know you want to try it.
   
Reply With Quote
Old
jwags
Junior Member
 
Status: Offline
Posts: 12
Join Date: Sep 2011
Location: brotherwags@aol.com
Default 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...")
(only do the bales that are for level 1) and make sue the functioni s a boolean

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
   
Reply With Quote
Old
caitlindlc
Junior Member
 
Status: Offline
Posts: 5
Join Date: Jan 2012
Default 01-17-2012, 11:51 AM

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

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

But I don't understand step 4. Drag what into b? I might have more questions as I progress through this project. Thank you so much for all of your help!!
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 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


<Insert_Signature_Here>
   
Reply With Quote
Old
caitlindlc
Junior Member
 
Status: Offline
Posts: 5
Join Date: Jan 2012
Default 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?
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 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.


<Insert_Signature_Here>
   
Reply With Quote
Old
caitlindlc
Junior Member
 
Status: Offline
Posts: 5
Join Date: Jan 2012
Default 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!)

   
Reply With Quote
Old
Mr Kidnapper
Senior Member
 
Status: Offline
Posts: 442
Join Date: Feb 2011
Default 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.
   
Reply With Quote
Old
caitlindlc
Junior Member
 
Status: Offline
Posts: 5
Join Date: Jan 2012
Default 01-30-2012, 09:26 AM

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!!!
Attached Files
File Type: a2w Eat the Hay.a2w (3.83 MB, 5 views)

Last edited by caitlindlc; 01-30-2012 at 09:26 AM. Reason: need to attach
   
Reply With Quote
Reply

Tags
games, how do i, level, levels, tutorial

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.