User Tools

Site Tools


mmbasic:eaten_earth

Eaten Earth

earth.zip

Short Animation Demo to show animations of large multi-tile sprites and pseudo scrolling. Exits to manual mode so you can play around with the various sprite animations.

Unzip the file and all the needed files are there.

Enjoy :) Anthony Clarke

'*****************************
'*   Eaten Earth Animation   *
'*           By              *
'*     Anthony Clarke        *
'*****************************
cls
mode 4

loadbmp "title.bmp"
pause 4000
cls
LoadBMP "BGSAVE.bmp" 'bssave image includes earth in it's start position for sprite background handling
Sprite Load "space.spr"


col2=16                     'earth position variables
col3=32
row2=16
row3=32
'top row
spr1x=103
spr1y=138
spr2x=spr1x+col2
spr2y=spr1y
spr3x=spr1x+col3
spr3y=spr1y
'middle row
spr4x=spr1x
spr4y=spr1y+row2
spr5x=spr1x+col2
spr5y=spr1y+row2
spr6x=spr1x+col3
spr6y=spr1y+row2
'bottom row
spr7x=spr1x
spr7y=spr1y+row3
spr8x=spr1x+col2
spr8y=spr1y+row3
spr9x=spr1x+col3
spr9y=spr1y+row3

'setting up eye position variables
eyespr1x=60
eyespr1y=5
eyespr2x=eyespr1x+16
eyespr2y=eyespr1y
eyespr3x=eyespr1x+16
eyespr3y=eyespr1y+16
eyespr4x=eyespr1x
eyespr4y=eyespr1y+16

'setting up teeth position variables
tooth1x=eyespr1x+8        'Top left
tooth1y=eyespr1y+60
tooth2x=eyespr1x+28         
tooth2y=eyespr1y+63
tooth3x=eyespr1x+48       'Left middle top
tooth3y=eyespr1y+66       
tooth4x=eyespr1x+68       'Right middle top
tooth4y=eyespr1y+66
tooth5x=eyespr1x+88
tooth5y=eyespr1y+63
tooth6x=eyespr1x+108      'Top Right
tooth6y=eyespr1y+60       
tooth7x=tooth1x           'Bottom Left
tooth7y=tooth1y+30
tooth8x=tooth2x
tooth8y=tooth2y+30
tooth9x=tooth3x           'Left middle bottom
tooth9y=tooth3y+30        
tooth10x=tooth4x          'Right middle bottom
tooth10y=tooth4y+30
tooth11x=tooth5x
tooth11y=tooth5y+30
tooth12x=tooth6x          'Bottom Right
tooth12y=tooth6y+30

moveSpeed=50                'variable for Earth move speed
width=100                   'variable for eye width
speed=15                    'first speed variable.. quick for blinking
speed2=50                   'second speed variable for slow reveal and disappear


scrLength=89          'Scrolling length


'Opening animation starting
'Dont turn on anu sprites above this line or BLIT will glitch
for x=1 to scrLength  'Using BLIT command to "Scroll" the screen to the left
BLIT 0,0,-1,0,240,216
BLIT 0,0,239,0,1,216
Pause 100
next x

blit 0,0,103,138,48,48   'copying blank part of the screen to cover bmp earth



'turning sprites on

'earth
Sprite on 1,spr1x,spr1y   'replacing BMP earth with sprite earth
Sprite on 2,spr2x,spr2y
Sprite on 3,spr3x,spr3y
Sprite on 4,spr4x,spr4y
Sprite on 5,spr5x,spr5y
Sprite on 6,spr6x,spr6y
Sprite on 7,spr7x,spr7y
Sprite on 8,spr8x,spr8y
Sprite on 9,spr9x,spr9y
earthOn=1                 'Earth on bool variable


'Left eye sprites
Sprite on 83,eyespr1x,eyespr1y  'sprites clockwise   
Sprite on 84,eyespr2x,eyespr2y
Sprite on 85,eyespr3x,eyespr3y
Sprite on 86,eyespr4x,eyespr4y
'right eye sprites
Sprite on 87,eyespr1x+width,eyespr1y 'sprites clockwise
Sprite on 88,eyespr2x+width,eyespr2y
Sprite on 89,eyespr3x+width,eyespr3y
Sprite on 90,eyespr4x+width,eyespr4y


'teeth sprites
sprite on 71,tooth1x,tooth1y   'top teeth left to right
sprite on 72,tooth2x,tooth2y
sprite on 73,tooth3x,tooth3y
sprite on 74,tooth4x,tooth4y
sprite on 75,tooth5x,tooth5y
sprite on 76,tooth6x,tooth6y
sprite on 77,tooth7x,tooth7y   'bottom teeth left to right
sprite on 78,tooth8x,tooth8y
sprite on 79,tooth9x,tooth9y
sprite on 80,tooth10x,tooth10y
sprite on 81,tooth11x,tooth11y
sprite on 82,tooth12x,tooth12y



EyeOpen=0                         'eyes open bool
TeethOn=0

'insert animation commands here
gosub EyeOpen
Gosub TeethOn
gosub Blink
Gosub Blink
Gosub Laugh
Gosub MouthOpen
'moving earth into mouth with sound
for y=1 to 69
  gosub MoveUp
  tone y+y+y+y+y,y+y+y+y+y
next y
tone stop

Gosub EarthOff'need earth disappearing animation here with sound
Sprite off 1 
Sprite off 2
Sprite off 3
Sprite off 4
Sprite off 5
Sprite off 6
Sprite off 7
Sprite off 8
Sprite off 9
pause 1000


Gosub MouthClose
gosub TalkOpen'Need talking here and print "Nom Nom Nom Nom" "Thanks for watching my little demo, Written by Anthony Clarke."
print @(74,140)"Nom,"
gosub Nom
Gosub TalkClose
Gosub TalkOpen
Print @(100,140)"Nom,"
Gosub Nom
gosub TalkClose
Gosub TalkOpen
Print @(128,140)"Nom,"
Gosub Nom
Gosub TalkClose
Gosub TalkOpen
Print @(156,140)"Nom."
Gosub Nom
Gosub TalkClose

gosub EyeClose
Gosub TeethOff


loadBmp "instr.bmp"

do while keydown = 0 'waiting for any key to proceed
loop
'Need screen explaining keys for manual mode

'setting up for manual mode
cls
loadbmp "Bg.bmp" 'turn earthless BG.BMP on
pause 1000
spr1x=103         'resetting eye position variables
spr1y=138
spr2x=spr1x+col2
spr2y=spr1y
spr3x=spr1x+col3
spr3y=spr1y
'middle row
spr4x=spr1x
spr4y=spr1y+row2
spr5x=spr1x+col2
spr5y=spr1y+row2
spr6x=spr1x+col3
spr6y=spr1y+row2
'bottom row
spr7x=spr1x
spr7y=spr1y+row3
spr8x=spr1x+col2
spr8y=spr1y+row3
spr9x=spr1x+col3
spr9y=spr1y+row3

Sprite on 1,spr1x,spr1y 'Turn earth sprites back on
Sprite on 2,spr2x,spr2y
Sprite on 3,spr3x,spr3y
Sprite on 4,spr4x,spr4y
Sprite on 5,spr5x,spr5y
Sprite on 6,spr6x,spr6y
Sprite on 7,spr7x,spr7y
Sprite on 8,spr8x,spr8y
Sprite on 9,spr9x,spr9y
gosub EarthOn
'Animation no longer running, going into manual control

main:     'I did have all these if statements in their own subroutines but then i had to double up for auto animations. So now they're here

'moving subroutines
  If KeyDown = 128 then 'if up arrow pressed
    gosub moveUp
  endif

  if keydown = 129 then   'if down arrow pressed
    gosub moveDown
  endif

  if keydown = 130 then   'if left arrow pressed
    gosub moveLeft
  endif

  if keydown = 131 then   'if right arrow pressed
    gosub moveRight
  endif
'blinking subroutine
  if keydown = 32 and eyesOpen=1 then 'if spacebar down then cycle eyeball animation
    gosub Blink
  endif
'Eye control subroutines
  if eyesOpen=1 and keydown=13 then       'if return is hit then
    gosub EyeClose
  endif

  if eyesOpen=0 and keydown=13 then 'If enter button is pressed
    GOSUB EyeOpen
  endif
'Teeth Control Subroutines
  if teethOn=1 and keydown=127 then 'If "delete" key is pressed and teeth are out then cycle teeth off animation
    gosub TeethOff
  endif

  if teethOn=0 and keydown=127 then 'if teeth are off and delete key is pressed then cycle teeth on animation
    gosub TeethOn
  endif
'Mouth Control Subroutines
  if mouthOpen=0 and keydown=132 then'If insert button is pressed
    gosub MouthOpen
  endif

  if mouthOpen=1 and Keydown=132 then 'if insert button pressed and mouth already open
    gosub MouthClose
  endif

'Talking Subroutines
  if keydown=116 and talkEnabled=0 then
    talkEnabled=1
    tone 600,600,100
    pause 500
  endif
  if keydown=116 and talkEnabled=1 Then
    talkEnabled=0
    tone 300,300,100
    pause 500
  endif

  if mouthOpen=0 and keydown=134 and talkEnabled=1 then'If insert button is pressed
    gosub TalkOpen
  Elseif mouthOpen=1 and Keydown<>134 and talkEnabled=1 then 'if insert button pressed and mouth already open
    gosub TalkClose
  endif
 'Earth on and off routines 
  if keydown=136 and earthOn=0 then 'If PgUp key pressed and Earth isn't on then goto EarthOn animation subroutine
    gosub EarthOn
  endif
  
  If Keydown=136 and earthOn=1 then'If PgUp Key pressed and Earth IS on then goto EarthOff animation routine
    gosub EarthOff
  endif

GoTo main   'end of main loop






MoveUp:

  'top row Earth
    spr1x=spr1x
    spr1y=spr1y-1
    spr2x=spr1x+col2
    spr2y=spr1y
    spr3x=spr1x+col3
    spr3y=spr1y
    'middle row
    spr4x=spr1x
    spr4y=spr1y+row2
    spr5x=spr1x+col2
    spr5y=spr1y+row2
    spr6x=spr1x+col3
    spr6y=spr1y+row2
    'bottom row
    spr7x=spr1x
    spr7y=spr1y+row3
    spr8x=spr1x+col2
    spr8y=spr1y+row3
    spr9x=spr1x+col3
    spr9y=spr1y+row3
    
    Sprite move 1,spr1x,spr1y
    Sprite move 2,spr2x,spr2y
    Sprite move 3,spr3x,spr3y
    Sprite move 4,spr4x,spr4y
    Sprite move 5,spr5x,spr5y
    Sprite move 6,spr6x,spr6y
    Sprite move 7,spr7x,spr7y
    Sprite move 8,spr8x,spr8y
    Sprite move 9,spr9x,spr9y
  endif    
pause moveSpeed
return

MoveDown:  

  'top row
    spr1x=spr1x
    spr1y=spr1y+1
    spr2x=spr1x+col2
    spr2y=spr1y
    spr3x=spr1x+col3
    spr3y=spr1y
    'middle row
    spr4x=spr1x
    spr4y=spr1y+row2
    spr5x=spr1x+col2
    spr5y=spr1y+row2
    spr6x=spr1x+col3
    spr6y=spr1y+row2
    'bottom row
    spr7x=spr1x
    spr7y=spr1y+row3
    spr8x=spr1x+col2
    spr8y=spr1y+row3
    spr9x=spr1x+col3
    spr9y=spr1y+row3
    
    Sprite move 9,spr9x,spr9y   'moving different sprites in different order depending on direction. Stops glitching
    Sprite move 8,spr8x,spr8y
    Sprite move 7,spr7x,spr7y
    Sprite move 6,spr6x,spr6y
    Sprite move 5,spr5x,spr5y
    Sprite move 4,spr4x,spr4y
    Sprite move 3,spr3x,spr3y
    Sprite move 2,spr2x,spr2y
    Sprite move 1,spr1x,spr1y
  endif
pause moveSpeed
Return

MoveLeft:  

  'top row
    spr1x=spr1x-1
    spr1y=spr1y
    spr2x=spr1x+col2
    spr2y=spr1y
    spr3x=spr1x+col3
    spr3y=spr1y
    'middle row
    spr4x=spr1x
    spr4y=spr1y+row2
    spr5x=spr1x+col2
    spr5y=spr1y+row2
    spr6x=spr1x+col3
    spr6y=spr1y+row2
    'bottom row
    spr7x=spr1x
    spr7y=spr1y+row3
    spr8x=spr1x+col2
    spr8y=spr1y+row3
    spr9x=spr1x+col3
    spr9y=spr1y+row3
    
    Sprite move 1,spr1x,spr1y   'moving different sprites in different order depending on direction. Stops glitching
    Sprite move 4,spr4x,spr4y
    Sprite move 7,spr7x,spr7y
    Sprite move 2,spr2x,spr2y
    Sprite move 5,spr5x,spr5y
    Sprite move 8,spr8x,spr8y
    Sprite move 3,spr3x,spr3y
    Sprite move 6,spr6x,spr6y
    Sprite move 9,spr9x,spr9y
  endif 
pause moveSpeed
Return

MoveRight:  

  'top row
    spr1x=spr1x+1
    spry=spry
    spr2x=spr1x+col2
    spr2y=spr1y
    spr3x=spr1x+col3
    spr3y=spr1y
    'middle row
    spr4x=spr1x
    spr4y=spr1y+row2
    spr5x=spr1x+col2
    spr5y=spr1y+row2
    spr6x=spr1x+col3
    spr6y=spr1y+row2
    'bottom row
    spr7x=spr1x
    spr7y=spr1y+row3
    spr8x=spr1x+col2
    spr8y=spr1y+row3
    spr9x=spr1x+col3
    spr9y=spr1y+row3
    
    Sprite move 3,spr3x,spr3y   'moving different sprites in different order depending on direction. Stops glitching
    Sprite move 6,spr6x,spr6y
    Sprite move 9,spr9x,spr9y
    Sprite move 2,spr2x,spr2y
    Sprite move 5,spr5x,spr5y
    Sprite move 8,spr8x,spr8y
    Sprite move 1,spr1x,spr1y
    Sprite move 4,spr4x,spr4y
    Sprite move 7,spr7x,spr7y
  endif    
 pause moveSpeed 
Return



Blink:

  sprite copy 18 to 83            'frame 1 left eye
  sprite copy 19 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  sprite copy 18 to 87           'frame 1 right eye
  sprite copy 19 to 88
  sprite copy 33 to 90
  sprite copy 32 to 89
  pause speed
  sprite copy 21 to 83           'frame 2 left eye
  sprite copy 20 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  sprite copy 21 to 87           'frame 2 right eye 
  sprite copy 20 to 88
  sprite copy 33 to 90      
  sprite copy 32 to 89
  pause speed
  sprite copy 22 to 83           'frame 3 left eye
  sprite copy 23 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  sprite copy 22 to 87           'frame 3 right eye
  sprite copy 23 to 88
  sprite copy 33 to 90
  sprite copy 32 to 89
  pause speed
  sprite copy 70 to 83            'frame 4 left eye
  sprite copy 70 to 84
  sprite copy 25 to 86
  sprite copy 24 to 85
  sprite copy 70 to 87            'frame 4 right eye
  sprite copy 70 to 88
  sprite copy 25 to 90      
  sprite copy 24 to 89
  pause speed              
  sprite copy 70 to 83            'frame 5 left eye
  sprite copy 70 to 84
  sprite copy 27 to 86
  sprite copy 26 to 85
  sprite copy 70 to 87            'frame 5 right eye
  sprite copy 70 to 88
  sprite copy 27 to 90
  sprite copy 26 to 89
  pause speed
  sprite copy 70 to 83            'frame 6 left eye
  sprite copy 70 to 84
  sprite copy 29 to 86
  sprite copy 28 to 85
  sprite copy 70 to 87            'frame 6 right eye
  sprite copy 70 to 88
  sprite copy 29 to 90         
  sprite copy 28 to 89
  pause speed
  sprite copy 70 to 83            'Fully closed left eye
  sprite copy 70 to 84
  sprite copy 70 to 86
  sprite copy 70 to 85
  sprite copy 70 to 87            'fully closed right eye
  sprite copy 70 to 88
  sprite copy 70 to 90
  sprite copy 70 to 89            'Eye closing animation complete......
  pause speed  

 'starting eye opening animation
  sprite copy 70 to 87            'frame 6 right eye
  sprite copy 70 to 88
  sprite copy 29 to 90         
  sprite copy 28 to 89
  sprite copy 70 to 83            'frame 6 left eye
  sprite copy 70 to 84
  sprite copy 29 to 86
  sprite copy 28 to 85
  pause speed 
  sprite copy 70 to 87            'frame 5 right eye
  sprite copy 70 to 88
  sprite copy 27 to 90
  sprite copy 26 to 89
  sprite copy 70 to 83            'frame 5 left eye
  sprite copy 70 to 84
  sprite copy 27 to 86
  sprite copy 26 to 85
  pause speed
  sprite copy 70 to 87            'frame 4 right eye
  sprite copy 70 to 88
  sprite copy 25 to 90      
  sprite copy 24 to 89
  sprite copy 70 to 83            'frame 4 left eye
  sprite copy 70 to 84
  sprite copy 25 to 86
  sprite copy 24 to 85
  pause speed
  sprite copy 22 to 87           'frame 3 right eye
  sprite copy 23 to 88
  sprite copy 33 to 90
  sprite copy 32 to 89
  sprite copy 22 to 83           'frame 3 left eye
  sprite copy 23 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  pause speed
  sprite copy 21 to 87           'frame 2 right eye 
  sprite copy 20 to 88
  sprite copy 33 to 90      
  sprite copy 32 to 89
  sprite copy 21 to 83           'frame 2 left eye
  sprite copy 20 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  pause speed
  sprite copy 18 to 87           'frame 1 right eye
  sprite copy 19 to 88
  sprite copy 33 to 90
  sprite copy 32 to 89
  sprite copy 18 to 83            'frame 1 left eye
  sprite copy 19 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  pause speed
  sprite copy 30 to 87           'fully open right eye
  sprite copy 31 to 88
  sprite copy 32 to 89
  sprite copy 33 to 90
  sprite copy 30 to 83            'fully open left eye
  sprite copy 31 to 84
  sprite copy 32 to 85
  sprite copy 33 to 86            'eye opening animation complete.
  pause speed
 
return






EyeClose:

  
  sprite copy 18 to 83            'frame 1 left eye
  sprite copy 19 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  sprite copy 18 to 87           'frame 1 right eye
  sprite copy 19 to 88
  sprite copy 33 to 90
  sprite copy 32 to 89
  pause speed2
  sprite copy 21 to 83           'frame 2 left eye
  sprite copy 20 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  sprite copy 21 to 87           'frame 2 right eye 
  sprite copy 20 to 88
  sprite copy 33 to 90      
  sprite copy 32 to 89
  pause speed2
  sprite copy 22 to 83           'frame 3 left eye
  sprite copy 23 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  sprite copy 22 to 87           'frame 3 right eye
  sprite copy 23 to 88
  sprite copy 33 to 90
  sprite copy 32 to 89
  pause speed2
  sprite copy 70 to 83            'frame 4 left eye
  sprite copy 70 to 84
  sprite copy 25 to 86
  sprite copy 24 to 85
  sprite copy 70 to 87            'frame 4 right eye
  sprite copy 70 to 88
  sprite copy 25 to 90      
  sprite copy 24 to 89
  pause speed2            
  sprite copy 70 to 83            'frame 5 left eye
  sprite copy 70 to 84
  sprite copy 27 to 86
  sprite copy 26 to 85
  sprite copy 70 to 87            'frame 5 right eye
  sprite copy 70 to 88
  sprite copy 27 to 90
  sprite copy 26 to 89
  pause speed2
  sprite copy 70 to 83            'frame 6 left eye
  sprite copy 70 to 84
  sprite copy 29 to 86
  sprite copy 28 to 85
  sprite copy 70 to 87            'frame 6 right eye
  sprite copy 70 to 88
  sprite copy 29 to 90         
  sprite copy 28 to 89
  pause speed2
  sprite copy 70 to 83            'Fully closed left eye
  sprite copy 70 to 84
  sprite copy 70 to 86
  sprite copy 70 to 85
  sprite copy 70 to 87            'fully closed right eye
  sprite copy 70 to 88
  sprite copy 70 to 90
  sprite copy 70 to 89            'Eye closing animation complete......
  
 
  eyesOpen=0                      'mark eyes as closed
Return


EyeOpen:

  
   'starting eye opening animation
  sprite copy 70 to 87            'frame 6 right eye
  sprite copy 70 to 88
  sprite copy 29 to 90         
  sprite copy 28 to 89
  sprite copy 70 to 83            'frame 6 left eye
  sprite copy 70 to 84
  sprite copy 29 to 86
  sprite copy 28 to 85
  pause speed2 
  sprite copy 70 to 87            'frame 5 right eye
  sprite copy 70 to 88
  sprite copy 27 to 90
  sprite copy 26 to 89
  sprite copy 70 to 83            'frame 5 left eye
  sprite copy 70 to 84
  sprite copy 27 to 86
  sprite copy 26 to 85
  pause speed2
  sprite copy 70 to 87            'frame 4 right eye
  sprite copy 70 to 88
  sprite copy 25 to 90      
  sprite copy 24 to 89
  sprite copy 70 to 83            'frame 4 left eye
  sprite copy 70 to 84
  sprite copy 25 to 86
  sprite copy 24 to 85
  pause speed2
  sprite copy 22 to 87           'frame 3 right eye
  sprite copy 23 to 88
  sprite copy 33 to 90
  sprite copy 32 to 89
  sprite copy 22 to 83           'frame 3 left eye
  sprite copy 23 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  pause speed2
  sprite copy 21 to 87           'frame 2 right eye 
  sprite copy 20 to 88
  sprite copy 33 to 90      
  sprite copy 32 to 89
  sprite copy 21 to 83           'frame 2 left eye
  sprite copy 20 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  pause speed2
  sprite copy 18 to 87           'frame 1 right eye
  sprite copy 19 to 88
  sprite copy 33 to 90
  sprite copy 32 to 89
  sprite copy 18 to 83            'frame 1 left eye
  sprite copy 19 to 84
  sprite copy 33 to 86
  sprite copy 32 to 85
  pause speed2
  sprite copy 30 to 87           'fully open right eye
  sprite copy 31 to 88
  sprite copy 32 to 89
  sprite copy 33 to 90
  sprite copy 30 to 83            'fully open left eye
  sprite copy 31 to 84
  sprite copy 32 to 85
  sprite copy 33 to 86            'eye opening animation complete.  
  
  if animEyesOpen=1 then        'If automatic command sent to perform animation.. reset command variable.
    animEyesOpen=0
  endif
  
  eyesOpen=1                      'mark eyes as open
  
endif
return


TeethOff:

'Teeth appearing annd disappering routines

  'fourth frame
  sprite copy 51 to 71        'top teeth left to right
  sprite copy 50 to 72
  sprite copy 49 to 73
  sprite copy 49 to 74
  sprite copy 50 to 75
  sprite copy 51 to 76
  
  sprite copy 55 to 77        'bottom teeth left to right
  sprite copy 54 to 78
  sprite copy 53 to 79
  sprite copy 53 to 80
  sprite copy 54 to 81
  sprite copy 55 to 82
  pause speed2
  'third frame
  sprite copy 52 to 71        'top teeth left to right
  sprite copy 51 to 72
  sprite copy 50 to 73
  sprite copy 50 to 74
  sprite copy 51 to 75
  sprite copy 52 to 76
  
  sprite copy 56 to 77        'bottom teeth left to right
  sprite copy 55 to 78
  sprite copy 54 to 79
  sprite copy 54 to 80
  sprite copy 55 to 81
  sprite copy 56 to 82
  pause speed2 
  'second frame
  sprite copy 70 to 71        'top teeth left to right
  sprite copy 52 to 72
  sprite copy 51 to 73
  sprite copy 51 to 74
  sprite copy 52 to 75
  sprite copy 70 to 76
  
  sprite copy 70 to 77        'bottom teeth left to right
  sprite copy 56 to 78
  sprite copy 55 to 79
  sprite copy 55 to 80
  sprite copy 56 to 81
  sprite copy 70 to 82
  pause speed2
  'first frame appearing
  sprite copy 70 to 71        'top teeth left to right
  sprite copy 70 to 72
  sprite copy 52 to 73
  sprite copy 52 to 74
  sprite copy 70 to 75
  sprite copy 70 to 76
  
  sprite copy 70 to 77        'bottom teeth left to right
  sprite copy 70 to 78
  sprite copy 56 to 79
  sprite copy 56 to 80
  sprite copy 70 to 81
  sprite copy 70 to 82
  pause speed2
  'Teeth disappeared
  sprite copy 70 to 71        'top teeth left to right
  sprite copy 70 to 72
  sprite copy 70 to 73
  sprite copy 70 to 74
  sprite copy 70 to 75
  sprite copy 70 to 76
  
  sprite copy 70 to 77        'bottom teeth left to right
  sprite copy 70 to 78
  sprite copy 70 to 79
  sprite copy 70 to 80
  sprite copy 70 to 81
  sprite copy 70 to 82
pause speed2

  teethOn=0
return

TeethOn:

  'first frame appearing
  sprite copy 70 to 71        'top teeth left to right
  sprite copy 70 to 72
  sprite copy 52 to 73
  sprite copy 52 to 74
  sprite copy 70 to 75
  sprite copy 70 to 76
  
  sprite copy 70 to 77        'bottom teeth left to right
  sprite copy 70 to 78
  sprite copy 56 to 79
  sprite copy 56 to 80
  sprite copy 70 to 81
  sprite copy 70 to 82
  pause speed2
  'second frame
  sprite copy 70 to 71        'top teeth left to right
  sprite copy 52 to 72
  sprite copy 51 to 73
  sprite copy 51 to 74
  sprite copy 52 to 75
  sprite copy 70 to 76
  
  sprite copy 70 to 77        'bottom teeth left to right
  sprite copy 56 to 78
  sprite copy 55 to 79
  sprite copy 55 to 80
  sprite copy 56 to 81
  sprite copy 70 to 82
  pause speed2
  'third frame
  sprite copy 52 to 71        'top teeth left to right
  sprite copy 51 to 72
  sprite copy 50 to 73
  sprite copy 50 to 74
  sprite copy 51 to 75
  sprite copy 52 to 76
  
  sprite copy 56 to 77        'bottom teeth left to right
  sprite copy 55 to 78
  sprite copy 54 to 79
  sprite copy 54 to 80
  sprite copy 55 to 81
  sprite copy 56 to 82
  pause speed2 

  'fourth frame
  sprite copy 51 to 71        'top teeth left to right
  sprite copy 50 to 72
  sprite copy 49 to 73
  sprite copy 49 to 74
  sprite copy 50 to 75
  sprite copy 51 to 76
  
  sprite copy 55 to 77        'bottom teeth left to right
  sprite copy 54 to 78
  sprite copy 53 to 79
  sprite copy 53 to 80
  sprite copy 54 to 81
  sprite copy 55 to 82
  pause speed2
  'back to full
  sprite copy 50 to 71        'top teeth left to right
  sprite copy 49 to 72
  sprite copy 40 to 73
  sprite copy 40 to 74
  sprite copy 49 to 75
  sprite copy 50 to 76
  
  sprite copy 54 to 77        'bottom teeth left to right
  sprite copy 53 to 78
  sprite copy 36 to 79
  sprite copy 36 to 80
  sprite copy 53 to 81
  sprite copy 54 to 82 
  
  pause speed2
  
  teethOn=1
endif
return



MouthOpen:    'Mouth open animation

    for y=1 to 18 step 1
      sprite move 71,tooth1x,tooth1y-y
      sprite move 72,tooth2x,tooth2y-y
      sprite move 73,tooth3x,tooth3y-y
      sprite move 74,tooth4x,tooth4y-y
      sprite move 75,tooth5x,tooth5y-y
      sprite move 76,tooth6x,tooth6y-y
      sprite move 77,tooth7x,tooth7y+y
      sprite move 78,tooth8x,tooth8y+y
      sprite move 79,tooth9x,tooth9y+y
      sprite move 80,tooth10x,tooth10y+y
      sprite move 81,tooth11x,tooth11y+y
      sprite move 82,tooth12x,tooth12y+y
      pause speed2
    next y
    
    tooth1y=tooth1y-18        'need to shift actual positions because they dont change in For Next loop.
    tooth2y=tooth2y-18
    tooth3y=tooth3y-18
    tooth4y=tooth4y-18
    tooth5y=tooth5y-18
    tooth6y=tooth6y-18
    tooth7y=tooth7y+18
    tooth8y=tooth8y+18
    tooth9y=tooth9y+18
    tooth10y=tooth10y+18
    tooth11y=tooth11y+18
    tooth12y=tooth12y+18
    
    mouthOpen=1

  endif
Return

MouthClose:  


  for y=1 to 18 step 1
      sprite move 71,tooth1x,tooth1y+y
      sprite move 72,tooth2x,tooth2y+y
      sprite move 73,tooth3x,tooth3y+y
      sprite move 74,tooth4x,tooth4y+y
      sprite move 75,tooth5x,tooth5y+y
      sprite move 76,tooth6x,tooth6y+y
      sprite move 77,tooth7x,tooth7y-y
      sprite move 78,tooth8x,tooth8y-y
      sprite move 79,tooth9x,tooth9y-y
      sprite move 80,tooth10x,tooth10y-y
      sprite move 81,tooth11x,tooth11y-y
      sprite move 82,tooth12x,tooth12y-y
      pause speed2
    next y
    tooth1y=tooth1y+18        'need to shift actual positions because they dont change in For Next loop.
    tooth2y=tooth2y+18
    tooth3y=tooth3y+18
    tooth4y=tooth4y+18
    tooth5y=tooth5y+18
    tooth6y=tooth6y+18
    tooth7y=tooth7y-18
    tooth8y=tooth8y-18
    tooth9y=tooth9y-18
    tooth10y=tooth10y-18
    tooth11y=tooth11y-18
    tooth12y=tooth12y-18
    
    
    mouthOpen=0  

endif

  return



TalkOpen:   'Talk animation subroutines

    for y=1 to 18 step 1
      sprite move 71,tooth1x,tooth1y-y
      sprite move 72,tooth2x,tooth2y-y
      sprite move 73,tooth3x,tooth3y-y
      sprite move 74,tooth4x,tooth4y-y
      sprite move 75,tooth5x,tooth5y-y
      sprite move 76,tooth6x,tooth6y-y
      sprite move 77,tooth7x,tooth7y+y
      sprite move 78,tooth8x,tooth8y+y
      sprite move 79,tooth9x,tooth9y+y
      sprite move 80,tooth10x,tooth10y+y
      sprite move 81,tooth11x,tooth11y+y
      sprite move 82,tooth12x,tooth12y+y
      pause 0
    next y
    gosub Nom
    tooth1y=tooth1y-18        'need to shift actual positions because they dont change in For Next loop.
    tooth2y=tooth2y-18
    tooth3y=tooth3y-18
    tooth4y=tooth4y-18
    tooth5y=tooth5y-18
    tooth6y=tooth6y-18
    tooth7y=tooth7y+18
    tooth8y=tooth8y+18
    tooth9y=tooth9y+18
    tooth10y=tooth10y+18
    tooth11y=tooth11y+18
    tooth12y=tooth12y+18
    
    mouthOpen=1
return

  


TalkClose:
  for y=1 to 18 step 1
      sprite move 71,tooth1x,tooth1y+y
      sprite move 72,tooth2x,tooth2y+y
      sprite move 73,tooth3x,tooth3y+y
      sprite move 74,tooth4x,tooth4y+y
      sprite move 75,tooth5x,tooth5y+y
      sprite move 76,tooth6x,tooth6y+y
      sprite move 77,tooth7x,tooth7y-y
      sprite move 78,tooth8x,tooth8y-y
      sprite move 79,tooth9x,tooth9y-y
      sprite move 80,tooth10x,tooth10y-y
      sprite move 81,tooth11x,tooth11y-y
      sprite move 82,tooth12x,tooth12y-y
      pause 0
    next y
    tooth1y=tooth1y+18        'need to shift actual positions because they dont change in For Next loop.
    tooth2y=tooth2y+18
    tooth3y=tooth3y+18
    tooth4y=tooth4y+18
    tooth5y=tooth5y+18
    tooth6y=tooth6y+18
    tooth7y=tooth7y-18
    tooth8y=tooth8y-18
    tooth9y=tooth9y-18
    tooth10y=tooth10y-18
    tooth11y=tooth11y-18
    tooth12y=tooth12y-18
    
    
    mouthOpen=0  

endif

return


Laugh:  'pretty much the best "Laugh" i could come up with with tone loops lol. Yeah it's pretty bad i know.

for i=1 to 4
  for x=600 to 1 step -0.15
    tone x,x
  next x
next i
for x=600 to 10 step -0.05
  tone x,x
next x

return

Nom:

for x=1 to 200 step 0.7
  tone x,x
next x
tone Stop
Return



EarthOn:    'earth on animation          

If earthOn=0 then
'frame 5
  sprite copy 127 to 1
  sprite copy 128 to 2
  sprite copy 129 to 3
  sprite copy 130 to 4
  sprite copy 131 to 5
  sprite copy 132 to 6
  sprite copy 133 to 7
  sprite copy 134 to 8
  sprite copy 135 to 9
  for x=1 to 167 step 3       'fitting sound into what used to be pause cycles
    tone x,x
  pause 1
  next x
'frame 4
  sprite copy 118 to 1
  sprite copy 119 to 2
  sprite copy 120 to 3
  sprite copy 121 to 4
  sprite copy 122 to 5
  sprite copy 123 to 6
  sprite copy 124 to 7
  sprite copy 125 to 8
  sprite copy 126 to 9
  for x=167 to 334 step 3       'fitting sound into what used to be pause cycles
    tone x,x
    pause 1
  next x
'frame 3
  sprite copy 109 to 1
  sprite copy 110 to 2
  sprite copy 111 to 3
  sprite copy 112 to 4
  sprite copy 113 to 5
  sprite copy 114 to 6
  sprite copy 115 to 7
  sprite copy 116 to 8
  sprite copy 117 to 9
  for x=334 to 500 step 3       'fitting sound into what used to be pause cycles
    tone x,x
    pause 1
  next x
'frame 2  
  sprite copy 100 to 1
  sprite copy 101 to 2
  sprite copy 102 to 3
  sprite copy 103 to 4
  sprite copy 104 to 5
  sprite copy 105 to 6
  sprite copy 106 to 7
  sprite copy 107 to 8
  sprite copy 108 to 9
   for x=500 to 667 step 3        'fitting sound into what used to be pause cycles
    tone x,x
    pause 1
  next x
'Frame 1
  sprite copy 91 to 1
  sprite copy 92 to 2
  sprite copy 93 to 3
  sprite copy 94 to 4
  sprite copy 95 to 5
  sprite copy 96 to 6
  sprite copy 97 to 7
  sprite copy 98 to 8
  sprite copy 99 to 9
  for x=667 to 834 step 3         'fitting sound into what used to be pause cycles
    tone x,x
    pause 1
  next x
'Frame Full
  sprite copy 141 to 1
  sprite copy 142 to 2
  sprite copy 143 to 3
  sprite copy 144 to 4
  sprite copy 145 to 5
  sprite copy 146 to 6
  sprite copy 147 to 7
  sprite copy 148 to 8
  sprite copy 149 to 9
  for x=834 to 1000 step 3        'fitting sound into what used to be pause cycles
    tone x,x
    pause 1
  next x
  tone stop
earthOn=1  
Return




EarthOff:   'Earth off animation

if earthOn=1 then
'Frame 1
  sprite copy 91 to 1
  sprite copy 92 to 2
  sprite copy 93 to 3
  sprite copy 94 to 4
  sprite copy 95 to 5
  sprite copy 96 to 6
  sprite copy 97 to 7
  sprite copy 98 to 8
  sprite copy 99 to 9
  for x=1000 to 834 step -3   'fitting sound into what used to be pause cycles
    tone x,x
    pause 1
  next x
'frame 2  
  sprite copy 100 to 1
  sprite copy 101 to 2
  sprite copy 102 to 3
  sprite copy 103 to 4
  sprite copy 104 to 5
  sprite copy 105 to 6
  sprite copy 106 to 7
  sprite copy 107 to 8
  sprite copy 108 to 9
  for x=834 to 667 step -3    'fitting sound into what used to be pause cycles
    tone x,x
    pause 1
  next x
'frame 3
  sprite copy 109 to 1
  sprite copy 110 to 2
  sprite copy 111 to 3
  sprite copy 112 to 4
  sprite copy 113 to 5
  sprite copy 114 to 6
  sprite copy 115 to 7
  sprite copy 116 to 8
  sprite copy 117 to 9
  for x=667 to 500 step -3    'fitting sound into what used to be pause cycles
    tone x,x
    pause 1
  next x
'frame 4
  sprite copy 118 to 1
  sprite copy 119 to 2
  sprite copy 120 to 3
  sprite copy 121 to 4
  sprite copy 122 to 5
  sprite copy 123 to 6
  sprite copy 124 to 7
  sprite copy 125 to 8
  sprite copy 126 to 9
  for x=500 to 334 step -3    'fitting sound into what used to be pause cycles
    tone x,x
    pause 1
  next x
'frame 5
  sprite copy 127 to 1
  sprite copy 128 to 2
  sprite copy 129 to 3
  sprite copy 130 to 4
  sprite copy 131 to 5
  sprite copy 132 to 6
  sprite copy 133 to 7
  sprite copy 134 to 8
  sprite copy 135 to 9
  for x=334 to 167 step -3    'fitting sound into what used to be pause cycles
    tone x,x
    pause 1
  next x
'frame Gone
  sprite copy 136 to 1
  sprite copy 136 to 2
  sprite copy 136 to 3
  sprite copy 136 to 4
  sprite copy 136 to 5
  sprite copy 136 to 6
  sprite copy 136 to 7
  sprite copy 136 to 8
  sprite copy 136 to 9
  for x=167 to 1 step -3      'fitting sound into what used to be pause cycles
    tone x,x
    pause 1
  next x
  tone stop
 earthOn=0 
endif


return


mmbasic/eaten_earth.txt · Last modified: 2024/01/19 09:30 by 127.0.0.1