TI99 Environment

# CALL_CHANGEANIMATIONDELAY and CALL_CHANGESPRITEANIMATIONDELAY

Syntax

CALL_CHANGEANIMATIONDELAY(AnimNum,Delay)

CALL_CHANGESPRITEANIMATIONDELAY(sprite-number,Delay)

Description

CALL_CHANGEANIMATIONDELAY changes the animation Delay speed for ALL sprites using AnimNum animation sequence. Delay speed is expressed in milliseconds. CALL_CHANGESPRITEANIMATIONDELAY changes the frame animation Delay speed for a specific sprite-number. A higher Delay slows down the animation sequence(s).

Example Code

    Example 1: CALL_CHANGEANIMATIONDELAY
    invader$="3C7EFFD5FF4224423C7EFFABFF4224243C7ED5FFFF4224423C7EABFFFF422424"
    call_char(128,invader$)
    call_magnify(2)
    call_screen(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)
    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()
    for i = 1 to numaliens
       call_colorsprite(i + invadersprite - 1,rnd(11)+3)
       MDelay = 50000
       call_createanimatedsprite(i + invadersprite - 1,rnd(4)+1,MDelay)
    next
    tiwaitkey() : randomize hitimer()
    for AnimNum = 1 to 5
       CALL_CHANGEANIMATIONDELAY(AnimNum,rnd(100) + 100)
       tiwaitkey()
    next AnimNum
    end

    Example 2: CALL_CHANGESPRITEANIMATIONDELAY

    call_magnify(3)
    randomize hitimer()
    call_char(140,rpt$("f",16)) `Road
    call_colorchar(140,5,1) `Road color
    call_char(141,"00181818181818") `Road line
    `Car-Frame 1
    call_multicolorchar(128,"00000022000008AA00E12A7700112A7700112A9900001A9900002799000027990000279900001A9900E12A9900112A7700112A77000002AA000001220000010020000000A80000007A21E0007A2110009A2110009A1000009720000097200000972000009A1000009A21E0007A2110007A211000A20000002100000001000000")
    `Car-Frame 2
    call_multicolorchar(132,"00000022000008AA00112A7700E12A7700112A9900001A9900002799000027990000279900001A9900112A9900E12A7700112A77000002AA000001220000010020000000A80000007A2110007A21E0009A2110009A1000009720000097200000972000009A1000009A2110007A21E0007A211000A20000002100000001000000")
    `Car-Frame 3
    call_multicolorchar(136,"00000022000008AA00112A7700112A7700E12A9900001A9900002799000027990000279900001A9900112A9900112A7700E12A77000002AA000001220000010020000000A80000007A2110007A2110009A21E0009A1000009720000097200000972000009A1000009A2110007A2110007A21E000A20000002100000001000000")
    `Bush
    call_multicolorchar(144,"00000000000000C000000CC00000CCCC000CCC0C0000CCCC000CCCCC0000CC0C000CCCCC00CCCC0C0000CCCC00000CC0000000CC0000000C0000000000000000000000000C000000CCC00000C0CC0000CCCCC000C0CC0000CCCC0000CCCCC000CCCCC000CCCC0000CC0CC000CCCC0000CC000000C00000000000000000000000")
    `Road sign
    call_multicolorchar(148,"CCCCCCCCCFFFCFCCCCFCCFCCCCFCCFCFCCFCCFCCCCFCCFCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC00EE000000EE000000EE000000EE000000EE0000CCCCCCCCCFFFCFFFCFCFCFCFCFFFCFFFCCCFCCCFCFFCCFFCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000EE000000EE000000EE000000EE000000EE00")
    CALL_CREATEANIMATION(1,128,3,4)
    call_sprite(1,128,0,150,110,0,0) `Car Sprite
    call_sprite(2,141,16,1,114,50,0) `Road Line sprite 1
    call_sprite(3,141,16,128,114,50,0) `Road Line sprite 2
    call_sprite(4,144,0,32,32,25,0) `Bush
    call_sprite(5,148,0,48,200,30,0) `Road sign
    call_magnifysprite(2,1)
    call_magnifysprite(3,1)
    CALL_CREATEANIMATEDSPRITE(1,1,25)
    call_vchar(1,12,140,168)
    do
       cardelay = rnd(50) + 25
       tiwaitkey()
       CALL_CHANGESPRITEANIMATIONDELAY(1,cardelay)
       for i = 2 to 5
          call_motion(i,90 - cardelay,0)
       next i
    loop

Go back to ...

TI99E Commands Menu
Main Menu

Copyright © Carlos Santiago Lebron - TI99 Environment 2020