TGC Codebase Backup



Happy Mouse by Mark Garrett

17th Jul 2005 22:52
Summary

Make happy faces on the screen with mouse with data commands. Press left mouse button. Press right mouse button to start over.



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    rem "Happy Mouse"

startover:
cls 



start1:

if mouseclick() =1 then goto draw
if mouseclick() = 2 then goto startover
goto start1


Draw:
sync on: sync rate 30


ink rgb(rnd(255),rnd(255),rnd(255)),1


rem x position of face and y position is centered:

x = mousex()-12 
y = mousey()-12

rem: data must be restored before each use
restore Happyface

Happyface:
data  , , , , , , , , ,9,9,9,9,9,9,9, , , , , , , , , 8
data  , , , , , , ,9,9,9,9,9,9,9,9,9,9,9, , , , , , , 8
data  , , , , , ,9,9, , , , , , , , , ,9,9, , , , , , 8
data  , , , , ,9,9, , , , , , , , , , , ,9,9, , , , , 8
data  , , , ,9,9, , , , , , , , , , , , , ,9,9, , , , 8
data  , , ,9,9, , , , , , , , , , , , , , , ,9,9, , , 8
data  , ,9,9, , , , , , , , , , , , , , , , , ,9,9, , 8
data  , ,9,9, , , , , ,9,9, , , , ,9,9, , , , ,9,9, , 8
data  , ,9,9, , , , ,9,9,9,9, , ,9,9,9,9, , , ,9,9, , 8
data  ,9,9, , , , , , ,9,9, , , , ,9,9, , , , , ,9,9, 8
data  ,9,9, , , , , , , , , , , , , , , , , , , ,9,9, 8
data  ,9,9, , , , , , , , , ,9,9, , , , , , , , ,9,9, 8
data  ,9,9, , , , , , , , , ,9,9, , , , , , , , ,9,9, 8
data  , ,9,9, , , , , , , , , , , , , , , , , ,9,9, , 8
data  , ,9,9, , , ,9,9, , , , , , , , ,9,9, , ,9,9, , 8
data  , , ,9,9, , , ,9,9, , , , , , ,9,9, , ,9,9, , , 8
data  , , ,9,9, , , ,9,9,9, , , , ,9,9,9, , ,9,9, , , 8
data  , , , ,9,9, , , ,9,9,9,9,9,9,9,9, , ,9,9, , , , 8
data  , , , ,9,9, , , , ,9,9,9,9,9,9, , , ,9,9, , , , 8
data  , , , , ,9,9, , , , ,9,9,9,9, , , ,9,9, , , , , 8
data  , , , , , ,9,9, , , , , , , , , ,9,9, , , , , , 8
data  , , , , , , ,9,9, , , , , , , ,9,9, , , , , , , 8
data  , , , , , , , ,9,9,9,9,9,9,9,9,9, , , , , , , , 8
data  , , , , , , , , , ,9,9,9,9,9, , , , , , , , , , 7






for t = 1 to 600

read data
`                         ( shift)
 if data = 8 then inc y:x = x - 25 
 
 if data = 9 then dot x,y

inc x

 next t
 
sync: sync off
goto start1