Page 4 of 4
Posted: Mon Oct 02, 2006 11:11 pm
by Dr. Dos
READ THE HELP FILE
LOOK AT GAMES WHICH HAVE DONE SIMILAR THINGS AND LOOK AT THE CODE
please.
Posted: Mon Oct 02, 2006 11:14 pm
by Quantum P.
There are a couple of ways to do this. If you're using the built-in enemies, you could have a door object that did something like the following. This example assumes that the room is filled with lions and tigers:
Code: Select all
#cycle 1
:loop
/i
#if any lions loop
#if any tigers loop
#die
#cycle 1 tells the object to run at maximum speed. The object waits a moment, then checks to see if there are any lions left; if so, it goes back to the beginning of the loop. If the lions are gone, it checks for tigers. The object will only leave the loop if the player has killed all the lions and tigers. At this point, the door will disappear (thanks to the #die command).
If you have object enemies (which I strongly recommend, as hardly anybody uses the built-in enemies anymore) you could do something like the following. This will be our enemy:
Code: Select all
@badguy
#cycle 2
:loop
?rndp rndne?seek?rndp rndne?seek
#if alligned shoot seek
#loop
:shot
Ack!
#give gems 1
#become red fake
Note that right before he dies, he will give the player one gem. Let's say that there will be a total of 10 enemies in the room (the code of the other 9 would be "#bind badguy") The door would then have code that looks like this:
Code: Select all
#cycle 1
:loop
/i#take gems 10 loop
#die
The number of gems that the player has represents the number of enemies in the room that he has killed. The door will constantly try to take 10 gems from the player; as soon as the player has 10 gems, he must have killed all 10 enemies, and the door opens.
Posted: Mon Oct 02, 2006 11:31 pm
by Quantum P.
Dos: I'm still trying to enjoy the fact that there's actually ZZT-related discussion at z2. :(
I'm willing to help with programming problems, ZZT Guy, but I strongly recommend reading the whole ZZT-OOP maunal through and looking at other people's games.
Posted: Tue Oct 03, 2006 1:34 am
by Zandor 12
Quantum P's right. Read the help file, get waist-deep into the code, and mess some shit up; asking questions is all well and good, but learning on your own is also keen!
In addition to ZZT Syndromes, I'd recommend looking at the ZZT Online Encyclopedia, a helpful collection of files that show several interesting programming tricks and engines. That stuff was like crack for me when I was first starting ZZT programming, and having a looksee will likely do you a world of good. The Mystical Winds Encyclopedia is also worth looking at; both of these help files should be somewhere on Z2.

Posted: Tue Oct 03, 2006 7:25 pm
by Dr. Dos
Quantum P. wrote:Dos: I'm still trying to enjoy the fact that there's actually ZZT-related discussion at z2. :(
I'm willing to help with programming problems, ZZT Guy, but I strongly recommend reading the whole ZZT-OOP maunal through and looking at other people's games.
Yes it's very unnatural, but these questions are all right in the manual other than the shop which is in like 75% of ZZT games ever.
Adventure 1 taught me how to make a store. It's why I use tp as my not enough counter label.
It stands for TooPoor!
Posted: Wed Oct 04, 2006 10:34 am
by Zenith Nadir
all these "hello i am making a zzt game how do i make an object shoot :)" threads warm my heart
i like them