User Tag List

Results 1 to 2 of 2

Thread: Link's Hitbox

  1. #1
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,763
    Level
    21
    vBActivity - Bars
    Lv. Percent
    69.32%

    Link's Hitbox

    Code:
    // For Link's hit detection. Don't count them if they are stunned or are guys.
    int GuyHit(int tx,int ty,int tz,int txsz,int tysz,int tzsz)
    {
    	//Calculate hitsize and hitoffsets
    	if ( Link.getExtend() >= 3 ) {
    		tx += Link.getHXOfs();
    		ty += Link.getHYOfs();
    		//tz += Link.getLinkHitZOffset();
    		txsz += ( Link.getHXSz() + Link.getHXOfs() );
    		tysz += ( Link.getHYSz() + Link.getHYOfs() );
    		//tzsz += Link.getLinkHitZHeight();
    	}
        for(int i=0; i<guys.Count(); i++)
        {
            if(guys.spr(i)->hit(tx,ty,tz,txsz,tysz,tzsz))
    Are the txsz, and tysx parameters something unusual here? By this, I mean what values are they using as inuts? I see some oddness in calls to this, such as GuyHit(LinkX()+*, LinkY+98), LinkZ(), 2, 2, ...)

    Is this vastly different from ordinary rect collision, because the '2' values are off to me.

  2. #2
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.52%
    I believe it's just a standard rectangle check (in ZC units, i.e. tiles are 16x16.)

    I don't know which line specifically you're referring to, but for example it's common to have calls like
    Code:
    GuyHit(x+7, y+7, 2, 2)
    to denote a small hitbox around the center of the sprite.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social