Game development on Z88dk

페이지 2/2
1 |

By zPasi

Champion (472)

zPasi의 아바타

28-02-2019, 17:11

fabento wrote:

i dont know how to make a sprite multiplexing routine (not flickering as i said Tongue ) and an interrupt routine also. i'm trying to use an interrupt routine (tried HKEYI and HTIMI hooks) but the game runs very slow using this ISR method...

I think the H_TIMI should work just fine.

The sprite multiplexing depends how are you doing sprites. But basically you just swap the "id", the first parameter.

LIke

put_sprite_16(0, x, y, player_shape, color); // the Player
put_sprite_16(1, x1, y1, enemy_shape, color); // enemies
...
put_sprite_16(10, x10, y10, enemy_shape, color); // the last enemy

Every other frame:

put_sprite_16(10, x, y, player_shape, color); // the Player
put_sprite_16(9, x,1 y1, enemy_shape, color); // enemies
...
put_sprite_16(0, x10, y10, enemy_shape, color); // the last enemy

Of course you'll use for-loops or something, but in principle.

By fabento

Supporter (6)

fabento의 아바타

01-03-2019, 00:22

i got it. thanks a lot!!!

https://youtu.be/LP7S1YJdNE0

페이지 2/2
1 |