RHillFake Posted June 27, 2014 Share Posted June 27, 2014 Hey. I cannot figure out how to use the life counter in the Batari Basic Commands. So if someone could give some code or a different explanation that would be great. Thanks! Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 27, 2014 Share Posted June 27, 2014 At the very end of your code include the mini kernel that you prefer for lives support inline 6lives.asm At the top where you dim your variables you can also "dim" whether your lives are centered (if the mini kernel supports it) dim lives_centered = 1Somewhere near the top (usually in the part where you're initializing things) you need to set the life color lifecolor = $46 If you want to add a life during game-play just increment the lives variable by 32 lives = lives + 32 If you want to take away a single life then subtract by 32 lives = lives - 32 Please note that 6lives.asm gives you six on-screen life icons. This means six lives = 192. Five lives = 160, etc.. EVERY TIME you call the drawscreen routine you must load up the sprite that is your life counter. I find this works best just before the drawscreen. lives: %00001000 %00011100 %00111110 %01111111 %11111111 %10111111 %01100110 %00000000end drawscreen 2 Quote Link to comment Share on other sites More sharing options...
RHillFake Posted June 27, 2014 Author Share Posted June 27, 2014 At the very end of your code include the mini kernel that you prefer for lives support inline 6lives.asm At the top where you dim your variables you can also "dim" whether your lives are centered (if the mini kernel supports it) dim lives_centered = 1 Somewhere near the top (usually in the part where you're initializing things) you need to set the life color lifecolor = $46 If you want to add a life during game-play just increment the lives variable by 32 lives = lives + 32 If you want to take away a single life then subtract by 32 lives = lives - 32 Please note that 6lives.asm gives you six on-screen life icons. This means six lives = 192. Five lives = 160, etc.. EVERY TIME you call the drawscreen routine you must load up the sprite that is your life counter. I find this works best just before the drawscreen. lives: %00001000 %00011100 %00111110 %01111111 %11111111 %10111111 %01100110 %00000000 end drawscreen Thanks. It worked 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.