Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Making a game on Alice, have some questions (http://www.alice.org/community/showthread.php?t=3191)

dominus 10-10-2009 04:09 PM

Making a game on Alice, have some questions
 
I am making a kind of game where many enemies will walk onto screen from the right, and you have to shoot and kill them before they reach you.

1. I will be using the same object as the enemies, so how would I make it so that they will keep appearing one after another? Or alternately, how would I put like 1,000 of them off the screen and just get them to walk on screen one after the other?

2. How can I make a 'counter' that will display how many enemies you have killed when the game is over?

x2495iiii 10-10-2009 04:40 PM

Making 1,000 would put too much strain on Alice, but you could put an object offscreen in a spot where the enemy can move to. Taht way, every time the enemy object is shot, it can disappear, move to the object, then reappear and walk onscreen again, meaning you only need one enemy.

For the counter, make a variable which increments when the enemy is shot, then have a 3d text which sets its text to the variable as a string when it increments.

scrubsfanchris 11-25-2009 06:05 AM

[QUOTE=x2495iiii;12203]

For the counter, make a variable which increments when the enemy is shot, then have a 3d text which sets its text to the variable as a string when it increments.[/QUOTE]

Where do I find "set text to" in Alice.
Thanks

x2495iiii 11-25-2009 06:30 AM

Click the 3d text, then click the properties tab on the left side of the screen. There's a property called text which you can drag on the scripting area to make a set text to method.

scrubsfanchris 11-25-2009 06:46 AM

Thanks [B]x2495iiii[/B]

Could you help me out here:
[url]http://www.alice.org/community/showthread.php?t=3465[/url]

x2495iiii 11-25-2009 06:54 AM

Alright.

I told you about the text already, and incrementing a variable is nearly the same process, drag the variable tile onto the scripting area and select increment variable.

To make a counter, increment the variable, then have the 3d text set its text to the variable.

scrubsfanchris 11-25-2009 07:10 AM

1 Attachment(s)
Thanks again [B]x2495iiii[/B], but it still wont work.
I think I am missing something, here's a screen shot:

x2495iiii 11-25-2009 07:28 AM

The way you have it set up now, it'll print the number that the loop is on (index), and then increment the counter variable by 1. Try this:

-change index to counter1

-delete the infinity loop

-put the increment variable statement in front of the set text statement

This way, the counter should increase by one, then the 3d text will set its value to the counter.

scrubsfanchris 11-25-2009 08:01 AM

1 Attachment(s)
I have it set up like this now, but it still wont work (do I have the chicken-hit method in the wrong place?)

Also, how do I get the 3D text "You Win" to appear when the counter reaches 4 and for the game to stop.
Thanks again.

x2495iiii 11-25-2009 08:21 AM

That depends on what the chicken-hit method does.


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

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