|
Post by alchemist on Apr 9, 2024 12:02:23 GMT
I see some ships and the scrolling is working now but the background still gets corrupted when moving left or right. Is that the same in your version? I also cannot reproduce the bug you described, can you upload a capture video? BTW That is a serious assembler program ..... nice job. This is a shapshot file of my game, press M (key fire 3) to restart the game and you will see the problem (note that, when it scrolls, ships appear and second palyer sprite disappears) prova.sna (48.02 KB)
|
|
|
Post by oss003 on Apr 9, 2024 18:03:08 GMT
Ok, looks like the player sprite is not removed before going to the next level. SO the old player sprite gets overdrawn with the new background and a new player sprite is drawn at the new position. When you move, both sprites move because they are both player sprites and the overdrawn player sprite is ghosting. You have 2 options to solve this: 1. At the end of the level, REMOVE the player and then start the new level where a new player sprite is spawned 2. Start the new level wihout spawning a new player sprite and change the X and Y coordinates of the old player sprite to the new position. Don't overwrite the old player sprite or you get ghosting. Option 1 looks like the best option. Oops .... looks like the sound of another Youtube video is added to my video ....
|
|
|
Post by oss003 on Apr 9, 2024 18:57:50 GMT
Fixed the problem with erasing the background now but if I press M or N, nothing happens ...... Is the code you sent not complete?
How do you start a new level?
|
|
|
Post by alchemist on Apr 10, 2024 8:29:32 GMT
Fixed the problem with erasing the background now but if I press M or N, nothing happens ...... Is the code you sent not complete? How do you start a new level? It's very strange. If i use the shapshot i sent you, pressing M the game restarts... It's not a new level, it's another game Pressing M the game restarts The game also ends if enemy ships reach your coast, you can try it How did you erase the background? I use CLS at the end of the game and in the GAME INIT event... p.s. do you know the MPAGD variable addresses? In classic AGD the were 32029, 32030 etc.
|
|
|
Post by oss003 on Apr 10, 2024 9:09:07 GMT
I'm testing the DELETEME.AGD file because I can add some debug commands in the file for testing. DELETEME.AGD only shows blue boats (see the uploaded videos) and no boat panels or overview with dots . Pressing M or N does nothing in the DELETEME.AGD file I do want to have a look at the next level routine because I think the bug is in that code. So that's why I asked you if there was some code missing.
I removed the SPRITEINK commands in the PLAYER event because that caused the background to be erased.
The snapshot file is behaving like you said. Did you upload the DELETEME.AGD file created when taking the snapshot?
|
|
|
Post by alchemist on Apr 10, 2024 15:43:10 GMT
I'm testing the DELETEME.AGD file because I can add some debug commands in the file for testing. DELETEME.AGD only shows blue boats (see the uploaded videos) and no boat panels or overview with dots . Pressing M or N does nothing in the DELETEME.AGD file I do want to have a look at the next level routine because I think the bug is in that code. So that's why I asked you if there was some code missing. I removed the SPRITEINK commands in the PLAYER event because that caused the background to be erased. The snapshot file is behaving like you said. Did you upload the DELETEME.AGD file created when taking the snapshot? This is the complete project (EngineZX is set to use 22 sprites) In player event there is the option to restart game (pressing R, key fire 3) Thanks for your attention project.zip (59.04 KB)
|
|
|
Post by oss003 on Apr 10, 2024 18:51:33 GMT
I'm getting an error when using 22 sprites because that's not possible in the 0.7.10 ZX Spectrum engine ..... If NUMSPR = 22 then SPRBUF = 22 x 17 = 374 At label xspr there is a command ld b,SPRBUF and that generates an error because the b-register can only store 1 byte numbers and 374 is too big. When I change NUMSPR = 14 then pressing the R-key works fine so spritedata gets overwritten or the wrong data is read with 22 sprites. When I look in SPRBUF after a reset, I can see multiple sprites type 0 (player) which explains why multiple crosses are moving after a reset ..... Attachments:
|
|
|
Post by oss003 on Apr 10, 2024 19:41:19 GMT
I think this patch in the engine fixes the problem. Attachments:
|
|
|
Post by ramon on Apr 11, 2024 6:00:21 GMT
Other version of the patch. ; Clear sprite table.
xspr ld b,NUMSPR ; sprite slots in table. ld ix,sprtab ; sprite table. ld de,TABSIZ ; distance to next odd/even entry. xspr0 ld (ix+0),255 ; delete sprite. ld (ix+1),255 ld (ix+2),255 ld (ix+3),255 ld (ix+4),255 ld (ix+5),255 ld (ix+6),255 ld (ix+7),255 ld (ix+8),255 ld (ix+9),255 ld (ix+10),255 ld (ix+11),255 ld (ix+12),255 ld (ix+13),255 ld (ix+14),255 ld (ix+15),255 ld (ix+16),255 add ix,de ; next sprite. djnz xspr0 ; one less space in the table. ret Included in arcadegamedesigner.proboards.com/thread/1040/sprite-limit-modification
|
|
|
Post by alchemist on Apr 11, 2024 10:30:08 GMT
Thanks for all your suggestions, now the game works fine!!!! Dear mas, oss003 and ramon, you were very very kind and, if you allow me, i'd like to thank you in my game presentation screen Thank you very much!
|
|
mas
Processing Plant
Posts: 28
|
Post by mas on Apr 12, 2024 14:32:56 GMT
Glad you were able to get it sorted. (I've found that everyone here is very helpful, and there is a lot of knowledge in a lot of those helpful heads). Good luck with the rest of the game! I'm looking forward to seeing the final game when all the code is complete.
|
|
|
Post by alchemist on Apr 17, 2024 6:27:53 GMT
Glad you were able to get it sorted. (I've found that everyone here is very helpful, and there is a lot of knowledge in a lot of those helpful heads). Good luck with the rest of the game! I'm looking forward to seeing the final game when all the code is complete. Coming soon
|
|