Twinkling Stars: Difference between revisions

From Wiki of ZZT
Jump to navigation Jump to search
(Created page)
 
(Code is now in a block rather than bullet points.)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
This code allows for the illusion of twinkling stars.
This code allows for the illusion of twinkling stars.
You can make a number of stars with various numbers of /i's after #char 32, with at least 3 lines different from each other, to better simulate an entire field of twinkling stars.
You can make a number of stars with various numbers of /i's after #char 32, with at least 3 lines different from each other, to better simulate an entire field of twinkling stars.
The 'animation' can be slowed down by setting the #cycle to 2 or 3, or by adding additional /i lines between the different #char commands.
The 'animation' can be slowed down by setting the #cycle to 2 or 3, or by adding additional /i lines between the different #char commands.


'''Caution: overuse of objects with the #cycle 1 command can EASILY overload the ZZT engine; even if the game is emulated at maximum speed on a fast computer.'''
#cycle 1
 
:twinkle
 
/i
#cycle 1
/i
:twinkle
#char 250
/i
/i
/i
#char 43
#char 250
/i
/i
#char 88
#char 43
/i
/i
#char 197
#char 88
/i
/i
#char 88
#char 197
/i
/i
#char 43
#char 88
/i
/i
#char 250
#char 43
/i
/i
#char 32
#char 250
/i
/i
/i
#char 32
/i  
/i
#twinkle
/i
/i
 
#twinkle


'''Caution''': Overuse of objects with the #cycle 1 command can cause ZZT to experience slowdown, even if the game is emulated on a fast computer.
[[Category: Examples]]
[[Category: Examples]]

Latest revision as of 23:12, 23 December 2025

This code allows for the illusion of twinkling stars.

You can make a number of stars with various numbers of /i's after #char 32, with at least 3 lines different from each other, to better simulate an entire field of twinkling stars.

The 'animation' can be slowed down by setting the #cycle to 2 or 3, or by adding additional /i lines between the different #char commands.

#cycle 1
:twinkle
/i
/i
#char 250
/i
#char 43
/i
#char 88
/i
#char 197
/i
#char 88
/i
#char 43
/i
#char 250
/i
#char 32
/i
/i
/i 
#twinkle

Caution: Overuse of objects with the #cycle 1 command can cause ZZT to experience slowdown, even if the game is emulated on a fast computer.