Jump to content

Photo

Trouble with 2x2 enemies


  • Please log in to reply
34 replies to this topic

#31 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 14 July 2012 - 06:34 PM

Okay, so I filled out the rest of the cases:

code


And I put "-8" in for BOTH Misc. Attr. 11 and Misc. Attr. 12.

Now it SHOULD have made an 8x8 pixel hitbox in the center of the 2x2 area, but INSTEAD
it made an 8x8 pixel hitbox that originates in the top left corner of the 2x2 area, extending 8 UP and 8 LEFT.

So now the hitbox is not even on top of the enemy. Any idea what went wrong?

Edited by Cukeman, 14 July 2012 - 06:37 PM.


#32 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 14 July 2012 - 07:21 PM

I think the draw X/Y offset should be negative twelve for that.

#33 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 14 July 2012 - 07:51 PM

Misc. Attr. 11 and Misc. Attr. 12. are supposed to set the size of the hitbox.
The location of the hitbox is supposed to be automatically determined by the script,
based on the size of the hitbox.

EDIT: If you look at the script you can see that I am trying to set it up for all extended enemies,
instead of having a different script for every single extended enemy.

Edited by Cukeman, 14 July 2012 - 07:56 PM.


#34 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 14 July 2012 - 08:49 PM

The offset is for the sprite, not the hitbox. Since you are moving the sprite, you will want to move it up/left (negative offset) to fit the hitbox.

#35 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 15 July 2012 - 12:21 AM

EDIT:

I fixed the code and it works now! YAY! Thank you SO much! :D  :D  :D 

code


All I have to do now is set Misc. Attr. 11 and Misc. Attr. 12 as the hitbox width and height (using negative numbers), and the offset automatically centers the hitbox in the 32x32 area  :D  .


Edited by Cukeman, 15 April 2016 - 05:10 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users