TI99 Environment

# CALL_PAUSEANIMATEDSPRITE and CALL_RESUMEANIMATEDSPRITE

Syntax

CALL_PAUSEANIMATEDSPRITE(sprite-number)

CALL_RESUMEANIMATEDSPRITE(sprite-number)

Description

CALL_PAUSEANIMATEDSPRITE pauses the animation of a specific sprite-number. Moving animated sprites will pause their animation sequence but will continue their current motion. CALL_RESUMEANIMATEDSPRITE resumes the animation of a specific sprite.

Example Code

    invader$="3C7EFFD5FF4224423C7EFFABFF4224243C7ED5FFFF4224423C7EABFFFF422424"
    call_char(128,invader$)
    call_magnify(2)
    `Define Animation sequences
    call_createanimation(1,128,4,1)
    call_createanimation(2,128,2,1)
    call_createanimation(3,129,2,1)
    call_createanimation(4,128,3,1)
    call_createanimation(5,129,3,1)
    call_screen(2)
    invadersprite = 450 : numaliens = 0
    `Create sprites
    xspeed = 1
    for invadery = 0 to 7
    for invaderx = 0 to 13
          call_sprite(invadersprite + numaliens,128,3,10 + 22 * invadery,1 + 18 * invaderx,0,xspeed * 3)
          inc numaliens
       next invaderx
       inc xspeed
    next invadery
    randomize hitimer()
    `Animate sprites using random animation sequences
    for i = 1 to numaliens
       call_colorsprite(i + invadersprite - 1,rnd(11)+3)
       MDelay = rnd(500) + 100
       call_createanimatedsprite(i + invadersprite - 1,rnd(4)+1,MDelay)
    next
    sprnum = invadersprite
    `Pause Animation of individual sprites at the press of a key
    while sprnum < invadersprite + numaliens
       tiwaitkey()
       call_magnifysprite(sprnum,1)
       call_colorsprite(sprnum,16)
       CALL_PAUSEANIMATEDSPRITE(sprnum)
       inc sprnum
    endwhile
    call_screen(8)
    tiwaitkey()
    call_screen(2)
    `Resume all previous Animations
    for i = 0 to numaliens
       call_colorsprite(i + invadersprite,rnd(11)+3)
       CALL_RESUMEANIMATEDSPRITE(i + invadersprite)
    next
    tiwaitkey()
    end

Go back to ...

TI99E Commands Menu
Main Menu

Copyright © Carlos Santiago Lebron - TI99 Environment 2020