joeyaage Posted October 3, 2022 Share Posted October 3, 2022 Hello, I have been steadily writing a new game with Raptor API. I already have had some success with Hellgate but have got a bit stuck (not without ideas). what you see is two separate sprites on the screen that are displayed correctly after initialising in rapinit.s. I am trying to change position of the sprites like I have already achieved in Hellgate like this: lea RAPTOR_sprite_table+(ID_ai_player*sprite_tabwidth),a0 ; point to RAPTOR object table move.w sprite_x(a0),d0 ; get player current X position move.w sprite_y(a0),d1 ; get player current Y position move.w #150,d0 ; initial player X pos. move.w #150,d1 ; initial player Y pos. move.w d0,sprite_x(a0) ; store the new x-position move.w d1,sprite_y(a0) ; store the new y-position What I don't know yet is where in memory (.BSS) is the RAPTOR_sprite_table, is it correctly in address a0, why is it that changing the value of sprite_x and sprite_y has no effect. From within a game loop I : jsr RAPTOR_wait_frame_UPDATE_ALL ; +VSYNC and update the object list with initial values jsr Player_Update_Position ; Move the player I can't seem to change positions of the sprites at all. 1 Quote Link to comment https://forums.atariage.com/topic/341956-new-original-game-codename-jagyong/ Share on other sites More sharing options...
+CyranoJ Posted October 3, 2022 Share Posted October 3, 2022 Happy to take a look if you'd like to share the code,, either here (public) or via a private discussion. Quote Link to comment https://forums.atariage.com/topic/341956-new-original-game-codename-jagyong/#findComment-5132352 Share on other sites More sharing options...
42bs Posted October 3, 2022 Share Posted October 3, 2022 Do you really intent to set x,y to a fixed position? If so, why read x,y in the first place? Quote Link to comment https://forums.atariage.com/topic/341956-new-original-game-codename-jagyong/#findComment-5132401 Share on other sites More sharing options...
joeyaage Posted October 3, 2022 Author Share Posted October 3, 2022 8 hours ago, CyranoJ said: Happy to take a look if you'd like to share the code,, either here (public) or via a private discussion. Private message sent.. 4 hours ago, 42bs said: Do you really intent to set x,y to a fixed position? If so, why read x,y in the first place? It's just left over code. I am aware there are wasted instructions. Quote Link to comment https://forums.atariage.com/topic/341956-new-original-game-codename-jagyong/#findComment-5132513 Share on other sites More sharing options...
joeyaage Posted October 6, 2022 Author Share Posted October 6, 2022 Hooray! CJ to the rescue. My problem was that I was defining sprite 'equ' as 0 - 'x number' for each of my 3 display lists. As soon as I defined all of the sprites from 0 -x number' across all three lists, my game and code magically came to life and now I can progress. Anyway, not got far yet. Here is a taster... jagyong15.ABS 4 Quote Link to comment https://forums.atariage.com/topic/341956-new-original-game-codename-jagyong/#findComment-5133867 Share on other sites More sharing options...
joeyaage Posted March 14, 2023 Author Share Posted March 14, 2023 I seem to be stuck on collision detection this time. I have these two subroutines called from the main loop. I don't think it ever goes to .was_hit after the bmi instruction. What_Was_Hit: lea RAPTOR_sprite_table+(ID_ai_player*sprite_tabwidth),a0 ; point to RAPTOR object table .chk_hit: tst.l sprite_was_hit(a0) ; check if this object was hit bmi .not_hit ; skip if not .was_hit: move.l #-1,sprite_was_hit(a0) ; clear RAPTOR collision flag jsr change_direction .not_hit: move.l #$99900000,BG ; set background colour rts ; exit Check_Collisions: clr.l raptor_result ; reset the RAPTOR collision flag move.l #ID_player,raptor_sourcel ; Object ID for first bullet move.l #ID_player,raptor_sourceh ; Object ID for last bullet move.l #ID_ai_player,raptor_targetl ; Object ID for first enemy move.l #ID_ai_player,raptor_targeth ; Object ID for last enemy lea RAPTOR_GPU_COLLISION,a0 ; now call the RAPTOR collision handler jsr RAPTOR_call_GPU_code ; tst.l raptor_result ; check the global collision flag ; bmi .no_hit ; if -ve, then nothing collided ; bsr change_direction ; otherwise lose a life ; bra .no_hit .no_hit: rts Binary and source included (no data files, so won't assemble). jagyong23.zip Original games are funny, I keep running into existing games... 2 Quote Link to comment https://forums.atariage.com/topic/341956-new-original-game-codename-jagyong/#findComment-5225163 Share on other sites More sharing options...
+CyranoJ Posted March 14, 2023 Share Posted March 14, 2023 Well for a start they are commented out ; lea RAPTOR_sprite_table+(ID_ai_player*sprite_tabwidth),a0 ; point to RAPTOR object table ; move.w sprite_x(a0),d0 ; get player current X position ; move.w #-3,sprite_xadd(a0) ; rts It probably is working... once... you need to set reset the collision flags after an impact: sprite_was_hit needs to go back to -1, and its hitpoints will need to go back to 1. 1 Quote Link to comment https://forums.atariage.com/topic/341956-new-original-game-codename-jagyong/#findComment-5225249 Share on other sites More sharing options...
joeyaage Posted May 14, 2023 Author Share Posted May 14, 2023 Whilst I am sorting out how to get Raptor collision working again, I have implemented some rudimentary bounding box collision in M68K. Now I am having problems getting sample playing to work again... jagyong28.ABS 1 Quote Link to comment https://forums.atariage.com/topic/341956-new-original-game-codename-jagyong/#findComment-5254265 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.