monster prodjectile

Logana

Well-known member
i was wondering how you would make a monster shoot a prodjectile like i see in other games made with nesmaker such as spirit impel and paws of the west, i had an idea for a boss to shoots a prodjectile in all 4 directions every so often but cant find the script to shoot prodjectiles for monsters in nesmaker 4.5.6
 

dale_coop

Moderator
Staff member
Here's a "ShootStraight.asm" Monster AI script:

Code:
	TXA 
	PHA
	

	LDA #21 ;; game object to create (monster's number start from 16...).
	STA tempC

	LDA Object_x_hi,x
	;; plus x offset
	CLC
	ADC #$08
	STA tempA
	
	LDA Object_y_hi,x
	;; plus y offset
	CLC
	ADC #$08
	STA tempB
	
	LDA #$00 ;; action step for that object
	STA tempD
	LDA Object_screen,x
	STA tempz

	LDA Object_direction,x
	AND #%00000111
	TAY
	LDA DirectionTableOrdered,y
	STA temp1
	LDA FacingTableOrdered,y
	STA temp2

	CreateObjectOnScreen tempA, tempB, tempC, tempD, tempz
	STX tempA


	StartMoving tempA, temp1, #$00
	ChangeFacingDirection tempA, temp2

+skipShootingStraight:	

	PLA
	TAX
Assign it to a unused Monster Action ... for your monster's object actions steps.

And for you Projectile object, set it as "monster weapon" with a speed and acceleration, "destroyMe" for solid/edge reaction a bounding and for the Action Step 0... only the "ignore gravity" flag.
 
Top Bottom