~Hakurei Shrine~ > Rika and Nitori's Garage Experiments
I'll get you fat pigeon
Naut:
As long as you've said that it isn't your own, then it should be fine. This is just a free program, not like any of us are making money to be stolen. Moderator's discretion, in any case.
Stuffman:
As far as I know we don't have a policy on that so I guess I get to make one up on the spot.
--- Quote ---As long as you've said that it isn't your own, then it should be fine.
--- End quote ---
Henceforth the ruling on this matter shalt be, What Naut Said.
The users of this board favor open source, good documentation, and sharing of coding techniques, which is why CtC grinds our gears so much.
JormundElver:
Hmm, I didn't know CtC grinded gears... I could post the scripting on how to animate their sprites too at some later point (unless someone else already did).
Their movement script is ran simply with this, which I often put in an index that loads with alot of my attacks:
--- Code: ---function GetGapLength( let xA, let yA, let xB, let yB ){
return ( ( xB - xA ) ^ 2 + ( yB - yA ) ^ 2 ) ^ 0.5;
}
function GetGapAngle( let xA, let yA, let xB, let yB ){
return atan2( yB - yA, xB - xA );
}
task MoveSlow( let x, let y, let frame ){
let _x = GetX();
let _y = GetY();
let force = GetGapLength( _x, _y, x, y ) * 2;
let angle = GetGapAngle( _x, _y, x, y );
SetMovePositionHermite( x, y, force, angle, 0, 0, frame - 1 );
loop( frame - 1 ){ yield; }
SetMovePosition02( x, y, 1 );
}
task MoveBoss( let minMoveX, let maxMoveX, let minMoveY, let maxMoveY, let marginX, let frame ){
let x = GetX();
let y = GetY();
let moveX = rand( minMoveX, maxMoveX );
let moveY = rand( minMoveY, maxMoveY );
if( x > GetPlayerX() ){
if( x - moveX >= GetClipMinX + marginX ){ moveX = - moveX; }
}
else{
if( x + moveX >= GetClipMaxX - marginX ){ moveX = - moveX; }
}
if( y > (GetClipMinY + 100) ){ moveY = - moveY; }
MoveSlow( x + moveX, y + moveY, frame );
}
task Move( let frame ){
let minMoveX = 40;
let maxMoveX = 80;
let minMoveY = 0;
let maxMoveY = 40;
let margin = 100;
MoveBoss( minMoveX, maxMoveX, minMoveY, maxMoveY, margin, frame );
}
--- End code ---
This gives you two movement commands, one being just Move(frames); this one moves the boss in the players direction over the set number of frames, slowing down as they near their destination. Handy because parameters are preset so you can pretty easily just Move(whatever) to move bosses around at certain times.
The other is MoveSlow(x, y, frames)... it's basically a move to position command but you also get the slowing down towards the end of the movement that seems to look smoother.
Hope this helps at least one person.
Naut:
Check for one person, I'll be using this often. I hate moving the boss around fluidly, so I'll just be abusing this script from now on. Thanks.
Also: CtC grinds gears because it's horribly documented and is completely holy shit everywhere. It's a POS resource for any mortal, so we all get pissed off at it because it does cool shit that we can't replicate.