Jump to content
IGNORED

new original game - codename jagYONG


joeyaage

Recommended Posts

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.

image.thumb.png.0a224118db0342acb3c6d4ff8e7168bb.png

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.
 

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

 

  • Like 4
Link to comment
Share on other sites

  • 5 months later...

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...jagYONG23.thumb.PNG.70dc6b41d8259079b43807ce21638a85.PNG

  • Like 2
Link to comment
Share on other sites

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.

 

 

 

 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...