How can I line up bullet spawn point with the monster's gun?

dale_coop

Moderator
Staff member
In the monster shoot script, you need to ajust the value of temp1 and temp2.
Which script are you using? (which module?)
 

dale_coop

Moderator
Staff member
Currenlty the script looks like:
Code:
	;; get offset
    LDA Object_x_hi,x
    STA temp1
    LDA Object_y_hi,x
    STA temp2
to
Code:
	;; get offset
    LDA Object_x_hi,x
    CLC
    ADC #$04  ;;<<-- horizontal offset of your weapon from your monster (change the value to adjust)
    STA temp1
    LDA Object_y_hi,x
    CLC
    ADC #$04  ;;<<-- vertical offset of your weapon from your monster (change the value to adjust)
    STA temp2
 

PortableAnswers

New member
dale_coop said:
Currenlty the script looks like:
Code:
	;; get offset
    LDA Object_x_hi,x
    STA temp1
    LDA Object_y_hi,x
    STA temp2
to
Code:
	;; get offset
    LDA Object_x_hi,x
    CLC
    ADC #$04  ;;<<-- horizontal offset of your weapon from your monster (change the value to adjust)
    STA temp1
    LDA Object_y_hi,x
    CLC
    ADC #$04  ;;<<-- vertical offset of your weapon from your monster (change the value to adjust)
    STA temp2

I am actually trying to change the projectile origin point for my player. I am using v4.0.6 and using the "a_create_projectile.asm" script. I have not altered it. Here's the code below. Also, how do I post my code properly like you? Will edit after.

LDA Object_x_hi,x
;;; offset x for creation
CLC
ADC #$04
STA temp
LDA Object_y_hi,x
CLC
ADC #$04
STA temp1
 

dale_coop

Moderator
Staff member
To post the code, when you are in in "full editor & preview mode", select your code, and clic on the button "< / >" it will add "[ C0DE ]" and "[ / C0DE ]".

Now, for your script :
Code:
	LDA Object_x_hi,x
	;;; offset x for creation
	CLC
	ADC #$04    ;;<<-- horizontal offset of your weapon from your player/monster (change the value to adjust)
	STA temp
	LDA Object_y_hi,x
	CLC
	ADC #$04    ;;<<-- vertical offset of your weapon from your player/monster (change the value to adjust)
	STA temp1
You can use ADC to increase the offset or SBC to decrease the offset. You would need to tests with different values until you find the correct one for your Player.
 

dale_coop

Moderator
Staff member
Do you use the "Melee" and "Projectile" game objects for your game?
Else, you could use them for your projectile.
The benefice is you can choose precisely the origin where this objects are created for each direction of the Player.
 

PortableAnswers

New member
Thank you for the information! With your advice, I was able to get the proper placement for one of the directions.
Yes, the static origin will be an issue for my character as his blaster weapon is essential to his design. I will need to have an origin point for each direction. Where should I start?
 

dale_coop

Moderator
Staff member
Do you use the "Melee" and "Projectile" game objects in your game?
If not, you could use those objets for your blaster's projectile (insted of the other projectile object).
The benefice is that you can choose precisely the origin where those objects are created, for each facing direction of the Player.
 

PortableAnswers

New member
Thank you for your help thus far! I have replied in my personal post from earlier entitled, "Projectile Origin Inquiry" where we were also discussing this.
 
Top Bottom