The Dink Network

Reply to Re: Why Can't I Quit You, DinkC?

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
December 16th 2013, 04:07 PM
custom_coco.gif
Cocomonkey
Bard He/Him United States
Please Cindy, say the whole name each time. 
I'm testing now to get ready for beta, and I've run into a big problem.

It's that boss with the invisible brain 9 "body" that takes damage for the visible brain 6 "head". If you throw fireballs at it, they hit it just fine and it takes damage as expected, but swiping your sword at it is no good. Since it's not quite 100% guaranteed that the player will even HAVE fireball at this point, this is a big problem. I can't figure out what's going on here at all.

The "body" is created with these lines in the script of the "head," which bounces around the room and has nohit set to 1:

&body = create_sprite(359, 224, 9, 780, 1)
sp_script(&body, "topbody")


And here's the main procedure for the "body" (it has no hit procedure):

void main
{
int &head
sp_brain(&current_sprite, 9)
sp_hitpoints(&current_sprite, 50)
sp_defense(&current_sprite, 4)
sp_nodraw(&current_sprite, 1)
//get sprite # of the "head"
&head = get_sprite_with_this_brain(6, 0)

mainloop:
//thenewguy came up with this sensible method of making sure this stays on top of the "head" sprite
&jug = sp_x(&head, -1)
sp_x(&current_sprite, &jug)

&jug = sp_y(&head, -1)
sp_y(&current_sprite, &jug)

//he had sp_dir here but it isn't necessary since it's just a looping animation really

wait(0)
goto mainloop
}


I'm certain it worked correctly when I tested it during development... what on Earth could be wrong here?

Oh... while I've been tinkering around trying to fix it, it stopped getting hurt by fireballs too. That's great.