Create Projectile doesn't work in platform module?

User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Create Projectile doesn't work in platform module?

Post by WolfMerrik » Sun Sep 02, 2018 8:02 pm

dale_coop wrote:
Sun Sep 02, 2018 7:36 pm
Yeah... nice script! Thanks to you.
It is turning into a nice (framework of a) script because of all of us! ;)

Thats what makes a community driven code project so awesome!
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
MrGodman
Posts: 8
Joined: Fri Aug 17, 2018 1:46 am

Re: Create Projectile doesn't work in platform module?

Post by MrGodman » Sun Sep 02, 2018 8:15 pm

i'm following this thread in real time putting the code together as i read the posts. I have to say you've helped me see (a little bit) how asm works. thanks everybody in this thread.
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Create Projectile doesn't work in platform module?

Post by WolfMerrik » Sun Sep 02, 2018 8:28 pm

MrGodman wrote:
Sun Sep 02, 2018 8:15 pm
i'm following this thread in real time putting the code together as i read the posts. I have to say you've helped me see (a little bit) how asm works. thanks everybody in this thread.
Thats great to hear!
I started learning bits of it from reading others code, although didn't really start learning till I just dove in.
Try it! if you mess something up, you just learn to never do that again lol
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
Convoy_Avenger
Posts: 63
Joined: Tue Aug 14, 2018 1:42 am

Re: Create Projectile doesn't work in platform module?

Post by Convoy_Avenger » Mon Sep 03, 2018 12:03 am

I think one of the main things I struggle with is what are the temps are referencing, and whenever there's a print out of "#%00000111" just doesn't make sense to me.

I have the projectiles firing, but they're not respecting my facing direction. And I look at this:

Code: Select all

gotDirForShoot:
LDA temp3
TAY
LDA DirectionMovementTable,y
ORA temp3
STA temp3
Try as I might, I have no idea how to parse that.


EDIT: Commented that whole bit out, and the game didn't seem to miss it. Not sure what's going on now.
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Create Projectile doesn't work in platform module?

Post by WolfMerrik » Mon Sep 03, 2018 2:08 am

The directional movement table PROBABLY isnt being used in this module, and was left over code from the adventure module (I can't check now, but I will)
You can always use the player's direction to launch the projectile?
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
Convoy_Avenger
Posts: 63
Joined: Tue Aug 14, 2018 1:42 am

Re: Create Projectile doesn't work in platform module?

Post by Convoy_Avenger » Mon Sep 03, 2018 2:39 am

So I had one of my programmer friends help me debug the problem. It took him a bit to understand what was going on, but the fact he got there is pretty amazing to me.

I(he) solved the problem, with some trouble shooting steps.

Basically, figured out the bullet was being spawned with Action Step 0 via Create Object, because changing the 00 gave my bullets some funny behavior. Knowing it was my action step that was the problem, it was easy to figure out from there that it was the fact I had "Ignore Main Physics" checked that was causing me so much trouble. Poor guy had to parse the entire code before getting to that last bit to help me with the problem.

I did learn a little, at least.
User avatar
ostincoolston
Posts: 40
Joined: Sun Apr 22, 2018 11:21 am

Re: Create Projectile doesn't work in platform module?

Post by ostincoolston » Sun Sep 09, 2018 4:53 pm

Code: Select all

LDX player1_object
    LDA #$00
    STA preventShooting
    LDA Object_movement,x
    AND #%00000111
    STA temp3
    CMP #%000000010
    BNE notRightForProjShoot
    LDA Object_x_hi,x
    CLC
    ADC #$18
    STA temp
    JMP gotDirForShoot
notRightForProjShoot:
    LDA Object_x_hi,x
    SEC
    SBC #$18
    STA temp
gotDirForShoot:
    LDA temp3
    TAY
    LDA DirectionMovementTable,y
    ORA temp3
    STA temp3
    

LDA Object_y_hi,x
STA temp1
LDA preventShooting
BNE +
ChangeObjectState #$03, #$08

CreateObject temp,temp1,#$01, #$00
    LDA temp3
    STA Object_movement,x

LDA #$01
STA preventShooting
+
RTS
I'm still having a hard time figuring out where in the code its saying where the projectile is spawning from and how I can change it to where I want. Currently its spawning up high from my player and I want it to spawn from the eye of my Eye-Bot
User avatar
dale_coop
Posts: 1612
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Create Projectile doesn't work in platform module?

Post by dale_coop » Sun Sep 09, 2018 5:36 pm

You need to change the value on the ADC line and the SBC line, to change the position of the projectile created.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
ostincoolston
Posts: 40
Joined: Sun Apr 22, 2018 11:21 am

Re: Create Projectile doesn't work in platform module?

Post by ostincoolston » Sun Sep 09, 2018 5:48 pm

How exactly are those number affecting it? I've tried a bunch of different hex values and I can only seem to get it to move left or right, it wont move below the top of my players head.
User avatar
dale_coop
Posts: 1612
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Create Projectile doesn't work in platform module?

Post by dale_coop » Sun Sep 09, 2018 5:59 pm

If you want to change its position vertically, you need to affect the object_y_hi
For example, replace:

Code: Select all

LDA Object_y_hi,x
STA temp1
By:

Code: Select all

LDA Object_y_hi,x
SBC #$08
STA temp1
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Post Reply