Shoot through Monster Barrier tile?

Razzie.P

Member
A little nudge in the right direction, please? My character shoots a rock (OBJECT_PLAYER_PROJECTILE with value of 1). It's set to destroy when colliding with a solid. However, how can I set it to ignore Monster Barriers, same as the player? Editing the "MonsterBarrier.asm" I thought it would be something as simple as doing the same thing as the code for player 1, but I'm not having any luck. Any pointers on what I'm not missing? Here's the code --

Code:
	CPX player1_object
	BEQ skipSolidRead
	;; not sure what the melee object is called.
	CPX Melee_object_whatever_its_called
	BEQ skipSolidRead

	LDA #TILE_SOLID
	STA tile_solidity

skipSolidRead:	
	;; if you want it solid, declare it at the end

As noted in the comment, I'm not sure what to enter for the Melee. I've tried a couple of things I saw referenced in other code, like "OBJECT_PLAYER_PROJECTILE," but it's not working.

Thanks in advance!
 

dale_coop

Moderator
Staff member
Try this one:

Code:
;;; SOLID
;;;This is how to inform a solid collision.
;;; You can also add this to the end of
;;; any tile type if you want it to have an effect AND
;;; be treated like solid.
;;; You could also check to see if it is a non-player object,
;;; and only return solid if it's a not player.  This would
;;; cause monsters to treat things like spikes or ladder or fire
;;; as solid while the player is able to interract with it.

	CPX player1_object
	BEQ skipSolidRead
	LDA Object_flags,x  ;; check the type of object
	AND #%00010100 		;; is it a player/monster weapon ? 
	BNE skipSolidRead	;; it IS, we skip	
	LDA #TILE_SOLID
	STA tile_solidity
skipSolidRead:	
	;; if you want it solid, declare it at the end

if should ignore collisions for the Player and all the weapons (player or monsters ones).
 
Top Bottom