2 Directional Enemy Movement

Mihoshi20

Member
Would it be possible in a future installment (If not already planned that is.) to have enemy behavior that moved in only 2 directions. For example enemies/sprites that moved only up and down or only left to right? Though I do have to say a huge thank you for having 8way and 4way directional movement right out of the gate for enemies. :)
 

stevenshepherd

New member
I could be wrong, but I suspect that as we get a more and more refined version of nesmaker, there will be more options for enemy movement. Certainly moving side to side would be a pretty general one include out of the box (especially given that this will be pretty necessary for platformers).
 

dale_coop

Moderator
Staff member
Ok then... I don't know ASM language, but I with NESMaker and Joe tutorials, I started to read and compares some of the scripts he wrote, and I tried to add those actions :)

So I inspired myself from the AI_Action_02.asp action script ("Move 4 directions"),
and modified the empty "AI_Action_06.asm" to :
Code:
;;;; Choose out of directions vertically.
    JSR GetRandomDirection
	AND #%00000100
    TAY
    LDA DirectionMovementTable,y
    STA temp
    TYA ;; the 0-7 value for direction
    ORA temp
    STA Object_movement,x

And I modified the empty "AI_Action_07.asm" to :
Code:
;;;; Choose out of directions horizontally
    JSR GetRandomDirection
	AND #%00000110
	ORA #%00000010
    TAY
    LDA DirectionMovementTable,y
    STA temp
    TYA ;; the 0-7 value for direction
    ORA temp
    STA Object_movement,x

Then, in "Project Labels > Action Types", I renamed AI_Behavior06 to "Move directions vertically" and AI_Behavior07 to "Move directions horizontally" ;)

Et voilà :)
I don't know if it's clean... but it's fun to test :) Looks that it does the job.

PS: please, if someone knows ASM, correct my code :p
 

stevenshepherd

New member
This is awesome. This is what i was hoping for from this program. I don't know code at all, but was hoping I could take existing code and just tweaking it
 

dale_coop

Moderator
Staff member
It's exactly as Joe said on his videos, we can tweak the program to do things we want :) It's awesome :) <3
 

Mihoshi20

Member
dale_coop said:
It's exactly as Joe said on his videos, we can tweak the program to do things we want :) It's awesome :) <3

Well, it works until a more seamless solution comes along that doesn't take up an AI behavior slot. Many thanks dale_coop.
 

RadJunk

Administrator
Staff member
Btw - you guys are demonstrating the exact design of this thing! You can imagine what will happen when ASM gurus start cranking and sharing code. Our goal is REALLY to provide the front end with a vanilla engine, but the engine will be super modifiable, and we’re hoping there ends up being endless ideas shares on how to do this or that. This is how the single tool will enable creation of very diverse games...the engine that exists is just a simple template. So it’s great to see people already playing around :)
 

Mihoshi20

Member
True, it's nice that an improvised solution could be found and that the engine's asm files are editable to begin with, I thought about doing the same just taking the 4 directional movement and splitting the function up. Though I'm hoping for an officially sanctioned implementation that is a default function in the editor as 2 directional movement is common in so many NES games and I'd have to port over the changed AI asm files with each new beta version that arrives. But yes, once the editor is finished and all the modules complete and people start digging into them, we're going to see some wicked cool customizations and changes that'll knock one's socks off.
 
Top Bottom