Jump to content
IGNORED

Shaking the IntyBASIC Screen?


First Spear

Recommended Posts

I recommend SCROLL, and it's the easiest to use - if you don't mind losing a few 16-bit variables. I've used the hardware registers for the shake effect.

 

 

CONST SCROLL_X = $30:CONST SCROLL_Y = $31 '---delay/scroll registers-
DIM ToggleShake,IsShaking, i
PRINT AT 80 COLOR 1,"Hit button to shake!"
MainLoop:    
    ToggleShake=FRAME AND 7        '--- 0 to 7
    PRINT AT 0,<3>ToggleShake    
    
    WAIT    '<----
    IF CONT1.B0 THEN
        POKE SCROLL_X,ToggleShake    '--scroll x
        IsShaking=0
    ELSEIF CONT1.B1 THEN
        POKE SCROLL_Y,ToggleShake    '--scroll y
        IsShaking=1
    ELSEIF CONT1.B2 THEN
        IF ToggleShake <4 THEN
            POKE SCROLL_X,3         '--shake x, every other frame
        ELSE
            POKE SCROLL_X,0    
        END IF         
        IsShaking=2
    ELSE
        POKE SCROLL_X,0            '--back to normal if no button held
        POKE SCROLL_Y,0        
        IsShaking=10
    END IF             
    PRINT AT 40,"B",<1>IsShaking
GOTO MainLoop

 

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...