YesNoOk
avatar

Code Snippet Archive (Read 131716 times)

Started by Bronko, May 28, 2005, 01:48:59 am
Share this topic:
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
Re: Code Snippet Archive
#62  November 20, 2011, 06:43:28 am
  • avatar
  • **
  • 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 = AngleDraw
trigger1 = 1
scale = const240p(abs(160-Screenpos X)/80)
Re: Code Snippet Archive
#63  May 15, 2012, 05:47:19 pm
  • avatar
  • **
  • Whatever.
Camera Lock
The title. Nuff' said.

Code:
[State 2700, Helper] ;Locker 1
type = helper
trigger1 = time = 0
helpertype = normal
postype = back
pos = 0,0
stateno = 2771
ID = 2771

[State 2700, Helper] ;Locker 2
type = helper
trigger1 = time = 0
helpertype = normal
postype = front
pos = 0,0
stateno = 27771
ID = 2771

;---------------------------------------------------------------------------
; Lock Left
[Statedef 2771]
type    = S
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 2771
poweradd = 0
sprpriority = 2

[State 0, PosSet]
type = PosSet
trigger1 = 1
x = 160
y = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,1

;---------------------------------------------------------------------------
; Lock Right
[Statedef 27771]
type    = S
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 2771
poweradd = 0
sprpriority = 2

[State 0, PosSet]
type = PosSet
trigger1 = 1
x = -160
y = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 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

Re: Code Snippet Archive
#64  May 16, 2012, 09:45:10 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
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.
Re: Code Snippet Archive
#65  May 16, 2012, 01:35:58 pm
  • avatar
  • **
  • 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

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

http://www.mediafire.com/download/35zjbsi2yr8v5g6/CodeDocs.zip

There are a lot of codes and stuff here.
- winkoeffect
- walljump
- stun
- slowmotion
- sfz2vism
etc. ; they are not made by me, I'm hosting them, so that they don't disappear (these are old, WinMugen era).
Who made these?
Necromancer/Flowagirl, Ragnarok, Doctor M, Chocobo etc., look at the ReadMe for details.

If they were already posted or if this is in the wrong topic, please move or delete it.