Code Snippet Archive (Read 207337 times)

Started by aokmaniac13, May 28, 2005, 01:48:59 AM

ZzEzZ

Helper Faces Opponent
#61  December 16, 2006, 07:33:13 AM
â€ his will make any projectile face the direction its going;
however, your projectile must be a helper...

put a value for "d" depending which way your projectile's sprite is facing, in the .sff
d = 0 if your projectile's sprite is facing right, d = 90 if your projectile's sprite is facing down, d = 180 if the sprite is facing left, d = 270 if the sprite is facing up.

[State 500, Angle]
type = AngleSet
trigger1 = 1
value = ((atan((-1*Vel Y)/Vel X))*(360/(2*pi))) + d

[State 500, Draw]
type = AngleDraw
trigger1 = 1
Last Edit: April 10, 2009, 09:53:19 AM by Cyanide

Nico Stein

Re: Code Snippet Archive
#62  November 20, 2011, 06:43:28 AM
• Nerdy artist & gamer.
Perspective Scaling
Basically, this code just adjusts the x scale of any animation of a flat object so that it fits more realistically in a perspective sense. e.g. Flat shockwaves, flat walls...
It isn't significant, but it's a cool detail, especially in 3D stages and on moving explods/projectiles/helpers.

Code:
`[State 0, Perspective]type = AngleDrawtrigger1 = 1scale = const240p(abs(160-Screenpos X)/80)`

Maistral

Re: Code Snippet Archive
#63  May 15, 2012, 05:47:19 PM
• Whatever.
Camera Lock
The title. Nuff' said.

Code:
`[State 2700, Helper] ;Locker 1type = helpertrigger1 = time = 0helpertype = normalpostype = backpos = 0,0stateno = 2771ID = 2771[State 2700, Helper] ;Locker 2type = helpertrigger1 = time = 0helpertype = normalpostype = frontpos = 0,0stateno = 27771ID = 2771;---------------------------------------------------------------------------; Lock Left[Statedef 2771]type    = Sphysics = Sjuggle  = 1velset = 0,0ctrl = 0anim = 2771poweradd = 0sprpriority = 2[State 0, PosSet]type = PosSettrigger1 = 1x = 160y = 0[State 0, ScreenBound]type = ScreenBoundtrigger1 = 1value = 1movecamera = 1,1;---------------------------------------------------------------------------; Lock Right[Statedef 27771]type    = Sphysics = Sjuggle  = 1velset = 0,0ctrl = 0anim = 2771poweradd = 0sprpriority = 2[State 0, PosSet]type = PosSettrigger1 = 1x = -160y = 0[State 0, ScreenBound]type = ScreenBoundtrigger1 = 1value = 1movecamera = 1,1`

MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks

Cyanide

Re: Code Snippet Archive
#64  May 16, 2012, 09:45:10 AM
• Legendary XIII
• I am the eye of the storm to come!
You don't need 2 helpers to achieve that, one is enough.

In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Maistral

Re: Code Snippet Archive
#65  May 16, 2012, 01:35:58 PM
• Whatever.
1 helper kept the camera sliding to the right.

I think this should be hassle-free from having to code the helper generated to be exactly middle

MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks

AlexSin

Re: Code Snippet Archive
#66  August 10, 2013, 01:30:45 PM
Necrobump!