Monster Barrier 4.5

TolerantX

Active member
I adapted this code from a previous NESmaker version

If someone who's more elegant with code would please like to add an updated code to exclude object #$01 (so your BULLET or MELEE or PLAYER 2 maybe is able to treat it as a NULL TILE ? ) Thank You.


Code:
;;; SOLID Collision in this code it affects everything except player Adapted from NESmaker 4.1.5
;;;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  ;; is it the player 1?
	BEQ skipSolidRead   ;; if it is not player 1 go to skipSolidRead

;;;;;

	LDA ObjectUpdateByte 
	ORA #%00000001
	STA ObjectUpdateByte ;; makes solid
	RTS
skipSolidRead:	
;;;;;        end of script
 

dale_coop

Moderator
Staff member
In the current "Summer Camp" module, you can't easily check the object flags (if a monster, a weapon ...) there is no object variable for that, so you would have to switch to another bank. I believe it's because this module is very limited to the minium... in order to be updated/completed.
It even doesn't use constants to define weapon or projectile object... in this summer camp scripts, everything is hardcoded for the project.

So, just for the same reason, the quickly way (with the Sumer Camp core!) is to "just" check the object_type for your project needs.
For example, here, adding a check for the projectile object at the beginning of the script :
Code:
	;; if player projectile, we skip
	LDA Object_type,x
	CMP #$01 		;; is it the projectile object? (in the Game Object list)
	BEQ skipSolidRead 	;; if it IS, we skip the code

When the code and modules will be the definitives ones, we can write a better script for that.
 

TolerantX

Active member
aww that's a bummer. I guess it's best to just use these all as good practice and exercises for now. :)
 
Top Bottom