Simple munching squares

Post Reply
User avatar
FreeFull
Posts: 41
Joined: Fri Dec 10, 2010 11:42 am

Simple munching squares

Post by FreeFull »

Displays the old Munching Squares display hack

Code: Select all

XSIZE = 128 //Make this equal to a power of two
YSIZE = XSIZE
TSIZE = XSIZE

resize_pixi(0,XSIZE,YSIZE)
clear( BLACK )
frame

x = 0
y = 0
t = 0

while 1 {
	while x<XSIZE {
		efx = x - (XSIZE/2) //Translated x
		while y<YSIZE {
			efy = y - (YSIZE/2) //Translated y
			oldpixel = get_dot(efx,efy)
			if (x^y)=t {
				oldpixel = oldpixel ^ WHITE
				dot(efx,efy,oldpixel)
			}
			y = y + 1
		}
		y = 0
		x = x + 1
	}
	x = 0
	t = (t + 1) & (TSIZE-1)
	frame(50)
}
Post Reply