Mugi
Member
this one is actually neat. it allows you to pause the game, but still control the character (change action states, but cant move)
https://youtu.be/nk5Lv5dFyNU
how this is made is really simple actually.
you need one variable (i call it "isPaused")
and one input script (i call it pause.asm)
place the above code into pause.asm and assign it to start button in MAIN GAME
then go to predraw and place the following in it (this is optional, but i suggest you use this to indicate that the game is paused.)
this draws 5 sprites to the screen (in my case, the text P A U S E ) from the bottom left corner of your gameobjecttiles.bmp
to draw something different, change the 3rd value in the DrawSprite macro to match whatever you wish to draw.
enjoy.
Edit: if you dont like the fact that the player can respond to inputs, add the following to the beginning of your input scripts
LDA isPaused
BEQ +
RTS
+
that way when the game is paused, inputs are being ignored (just dont set that to the pause script )
https://youtu.be/nk5Lv5dFyNU
how this is made is really simple actually.
you need one variable (i call it "isPaused")
and one input script (i call it pause.asm)
Code:
LDA isPaused
BNE unpausegame
LDA gameHandler
ORA #%00100000 ;; objects bit
STA gameHandler
LDA #$01
STA isPaused
JMP theEnd
unpausegame:
LDA gameHandler
AND #%11011111 ;; objects bit
STA gameHandler
LDA #$00
STA isPaused
theEnd:
place the above code into pause.asm and assign it to start button in MAIN GAME
then go to predraw and place the following in it (this is optional, but i suggest you use this to indicate that the game is paused.)
Code:
LDA isPaused
BNE +
JMP isNotPaused
+
DrawSprite #$6C, #$78, #$70, #%00000001, spriteOffset
UpdateSpritePointer
DrawSprite #$76, #$78, #$71, #%00000001, spriteOffset
UpdateSpritePointer
DrawSprite #$80, #$78, #$72, #%00000001, spriteOffset
UpdateSpritePointer
DrawSprite #$8A, #$78, #$73, #%00000001, spriteOffset
UpdateSpritePointer
DrawSprite #$94, #$78, #$74, #%00000001, spriteOffset
UpdateSpritePointer
isNotPaused:
this draws 5 sprites to the screen (in my case, the text P A U S E ) from the bottom left corner of your gameobjecttiles.bmp
to draw something different, change the 3rd value in the DrawSprite macro to match whatever you wish to draw.
enjoy.
Edit: if you dont like the fact that the player can respond to inputs, add the following to the beginning of your input scripts
LDA isPaused
BEQ +
RTS
+
that way when the game is paused, inputs are being ignored (just dont set that to the pause script )