|
Post by miguetelo on May 31, 2024 8:01:53 GMT
Hi all! Is it possible to reduce the speed of the laser? it moves very fast I imagine it will have to be modified in the engine code, but I don't know how to do it. Thank you!
_________
Buenas!! ¿Sabéis si es posible reducir la velocidad del láser? Se mueve muy rápido Imagino que habrá que modificarlo en el código del motor, pero no sé como se puede hacer. ¡Gracias!
|
|
mas
Endorian Forest
![*](//storage.proboards.com/forum/images/stars/star.png) ![*](//storage.proboards.com/forum/images/stars/star.png)
Posts: 60
|
Post by mas on May 31, 2024 13:17:32 GMT
Hi all! Is it possible to reduce the speed of the laser? it moves very fast I imagine it will have to be modified in the engine code, but I don't know how to do it. Thank you! Hi there, I think the LASER is a fixed speed. If you have sprites free, you could switch out the laser for a "player bullet" which has code looking like:
IF DIRECTION RIGHT LET IMAGE = 0 REPEAT 6 IF CANGORIGHT SPRITERIGHT IF Y > RIGHTEDGE REMOVE ENDIF ELSE REMOVE ENDIF ENDREPEAT ENDIF ANIMATE FAST
and that can be adjusted to make quicker/ slower by how many times it repeats or what triggers the repeat. In the regular documentation I don't see LASER taking anything other than just a left or right parameter (if you give it numbers, even shoots left, odd shoots right; but the number doesn't appear to affect the speed).
If you feel like hacking the asm, look at the engine.asm (It'll be in the Suite ZX/AGD folder). If you change the line here (ld b,8) to ld b, some other number the speed changes. smaller numbers are slower, bigger are faster
laser ld a,(ix+1) ; direction. rra ; left or right? jr nc,laserl ; move left.
;;; I THINK THIS IS THE BIT ;; default is setting b to 8, if we change it to 4 it goes half the speed ;; change it to 16 it is zippy
; ld b,8 ; distance to travel. ld b,4 ; distance to travel. jr laserm ; move laser.
(Open it in notepad or something similar and search for "laserm" )
hope that helps. M.
|
|
|
Post by miguetelo on Jun 2, 2024 18:33:40 GMT
I discovered this
Changing the line you said: ld b,4 ; distance to travel. works for the laser going right and this is the line you have to change to the laser going left:
laserl ld b,251 ; it was b,248 (in the original engine) and for me 252 seems to work fine. it moves slower I will keep testing if it works fine in the game. Thank you again
Hi all! Is it possible to reduce the speed of the laser? it moves very fast I imagine it will have to be modified in the engine code, but I don't know how to do it. Thank you! Hi there, I think the LASER is a fixed speed. If you have sprites free, you could switch out the laser for a "player bullet" which has code looking like: IF DIRECTION RIGHT LET IMAGE = 0 REPEAT 6 IF CANGORIGHT SPRITERIGHT IF Y > RIGHTEDGE REMOVE ENDIF ELSE REMOVE ENDIF ENDREPEAT ENDIF ANIMATE FAST and that can be adjusted to make quicker/ slower by how many times it repeats or what triggers the repeat. In the regular documentation I don't see LASER taking anything other than just a left or right parameter (if you give it numbers, even shoots left, odd shoots right; but the number doesn't appear to affect the speed). If you feel like hacking the asm, look at the engine.asm (It'll be in the Suite ZX/AGD folder). If you change the line here (ld b,8) to ld b, some other number the speed changes. smaller numbers are slower, bigger are faster
laser ld a,(ix+1) ; direction. rra ; left or right? jr nc,laserl ; move left.
;;; I THINK THIS IS THE BIT ;; default is setting b to 8, if we change it to 4 it goes half the speed ;; change it to 16 it is zippy
; ld b,8 ; distance to travel. ld b,4 ; distance to travel. jr laserm ; move laser.
(Open it in notepad or something similar and search for "laserm" )
hope that helps. M.
|
|
mas
Endorian Forest
![*](//storage.proboards.com/forum/images/stars/star.png) ![*](//storage.proboards.com/forum/images/stars/star.png)
Posts: 60
|
Post by mas on Jun 3, 2024 9:56:01 GMT
Hey there! Thank you for letting me know. I hadn't noticed there was a different speed setting for the other direction, well done in spotting that. The assembler code for the engine is pretty well commented, which does make it easier to identify/ adjust a lot of the sections. I just have to make sure I make a back up of the file before changing too much of it... just in case :-)
Good luck with the rest of the game, and well done in catching that. Looking forward to seeing the completed game. M.
|
|