ZZT Guy's ZZT Questions
Moderators: Commodore, Zenith Nadir
ZZT Guy's ZZT Questions
Im an extreme ZZT noob but...
How do i get it so that when I
touch a character it says its message?
when i make a message object, and go
into the room its in, it says its text as soon as i move one space!
How do i get it so that when I
touch a character it says its message?
when i make a message object, and go
into the room its in, it says its text as soon as i move one space!
Last edited by ZZT Guy on Wed Sep 27, 2006 6:39 pm, edited 1 time in total.
- Schroedingers Cat
- We must invent teleportation!
- Posts: 721
- Joined: Mon Jun 19, 2006 11:35 pm
- Location: Idaho, Wisconsin
Code: Select all
@person
#cycle 1
#end
'this is a comment.
'ZZT ignores all comments.
'comments begin with a '.
'they don't end until the next line.
'comments are used to help the programmer.
'they have no bearing on gameplay.
:touch
Hello!
/w 'tells the object to go one square west, regardless of whether or
'not the space is blocked. The object will keep trying until it suceeds.
'alternativly, you could use "?w", which tells the object to try to go west,
'but if it can't, no biggie.
#end
ThanksSchrödinger's Cat wrote:Code: Select all
@person #cycle 1 #end 'this is a comment. 'ZZT ignores all comments. 'comments begin with a '. 'they don't end until the next line. 'comments are used to help the programmer. 'they have no bearing on gameplay. :touch Hello! /w 'tells the object to go one square west, regardless of whether or 'not the space is blocked. The object will keep trying until it suceeds. 'alternativly, you could use "?w", which tells the object to try to go west, 'but if it can't, no biggie. #end
EDIT:Alright, im thinking on making a Mario game,
so how do i get it to where a message object will walk around, shoot bullets at you, and die after 3 hits?
- Dr. Dos
- OH YES! USE VINE WHIP! <3
- Posts: 1772
- Joined: Tue Mar 11, 2003 12:00 am
- Location: Washington
You should really check out similar games and look at the code in there. I'm pretty sure Link's Adventure taught me a lot about making enemies.
But to move around randomly you can use /rnd or #go rnd
For shooting #shoot rnd or #shoot seek to shoot at the player
As for multiple hits:
You can use labels instead of #restart and can actually shorten the code to
But to move around randomly you can use /rnd or #go rnd
For shooting #shoot rnd or #shoot seek to shoot at the player
As for multiple hits:
Code: Select all
@Blah
BLAH BLAH CODE HERE
#end
:shot
#zap shot
#restart
:shot
#zap shot
#restart
:shot
#die
Code: Select all
#end
:shot
:shot
#zap shot
#restart
:shot
#die
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter
Apologies for the old post you may have just read.
Follow Worlds of ZZT on Twitter
Apologies for the old post you may have just read.
- Quantum P.
- Level 17 Accordion Thief
- Posts: 1433
- Joined: Fri Sep 12, 2003 1:41 am
- Location: Edmonds, WA
- Contact:
Welcome, ZZT Guy! In order for the object to keep on moving, you need to set up a loop. There are a couple of ways of doing this:
This program has two instructions: (1) Move randomly. (2) Go back to instruction #1. It is easy to see that the object will not stop moving.
This is the way I prefer. It's three lines now, but it's more descriptive. The object reads the first line, which it ignores for the moment. It reads the second line and takes a step in a random direction. It reads the third line, which tells the object to go back to the line that says ":runaround".
Code: Select all
/rnd
#restart
Code: Select all
:runaround
/rnd
#runaround
ThanksQuantum P. wrote:Welcome, ZZT Guy! In order for the object to keep on moving, you need to set up a loop. There are a couple of ways of doing this:
This program has two instructions: (1) Move randomly. (2) Go back to instruction #1. It is easy to see that the object will not stop moving.Code: Select all
/rnd #restart
This is the way I prefer. It's three lines now, but it's more descriptive. The object reads the first line, which it ignores for the moment. It reads the second line and takes a step in a random direction. It reads the third line, which tells the object to go back to the line that says ":move".Code: Select all
:move /rnd #move
- thematrixeatsyou
- ‮Ouch.
- Posts: 44
- Joined: Wed Sep 06, 2006 8:50 am
- Quantum P.
- Level 17 Accordion Thief
- Posts: 1433
- Joined: Fri Sep 12, 2003 1:41 am
- Location: Edmonds, WA
- Contact:
- Zenith Nadir
- this is my hammer
- Posts: 2767
- Joined: Wed Mar 12, 2003 11:40 am
- Location: between the black and white spiders
-
- LOOK OUT FER BAAAD BOB
- Posts: 116
- Joined: Fri Mar 28, 2003 12:51 am
- Schroedingers Cat
- We must invent teleportation!
- Posts: 721
- Joined: Mon Jun 19, 2006 11:35 pm
- Location: Idaho, Wisconsin
-
- LOOK OUT FER BAAAD BOB
- Posts: 116
- Joined: Fri Mar 28, 2003 12:51 am