Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

Hi John, 

Just a quick example based on the code generated by the Foundry for a new standard program:

#INCLUDE <torvin_next_foundry.bas> 
#INCLUDE <keys.bas> 
#INCLUDE <torvin_vortexmusic.bas> 
#INCLUDE <torvin_aysfx.bas>  
CONST   FONT_BANK AS UBYTE = 34 
CONST   DRIVER_BANK AS UBYTE = 36 
CONST   MUSIC_BANK AS UBYTE = 37 
CONST   SFX_BANK AS UBYTE = 39 
const   sprite_bank as ubyte = 50  
Init() 
Main()  
STOP  
SUB Init()     
LoadToBanks("ASSETS/font256_1.spr",FONT_BANK,0)     
LoadToBanks("ASSETS/ts4000.bin",DRIVER_BANK,0)     
LoadToBanks("ASSETS/TestMusic.pt3",MUSIC_BANK,0)     
LoadToBanks("ASSETS/gameSFX.afb",SFX_BANK,0)     
LoadToBanks("ASSETS/cubo.spr",sprite_bank,0)     '<---- add a spr file 
END SUB  
' ============================================================================================ 
'  Main Control Loop 
' ============================================================================================ 
SUB Main() 
    DIM sKeyReleased AS UBYTE 
    dim scrollamount as ubyte     
 
    Music_Init(DRIVER_BANK, MUSIC_BANK)     
    SFX_Init(SFX_BANK)     
    Layer256On(1,0)      
    Music_Start()      
    Display256BMP("ASSETS/prueba.bmp")
    SpritesOn()     
    'LoadSpritePatterns(64,0,sprite_bank,0)       '<------  is the problem here?
    InitSmallSprite(0,100,100,1)      
        
    DO         
        if multikeys(KEYL) then             
            while multikeys(KEYL)             
            wend             
            Display256BMP("ASSETS/font256_1.bmp")         
        end if          
        scrollamount=scrollamount+1         
        ScrollLayer256(scrollamount,0)          
        WaitScanLine(192)         
        Music_PlayFrame()         
        SFX_PlayFrame()     
    LOOP 
END SUB

While then program is running, if you press L key, it loads a new BMP and the scroll continues... but if you uncomment the 

LoadSpritePatterns

line, when you press the L key, the program freezes...

I hope it helps. Please, let me know if I must do another example.

Best regards