mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge pull request #9694 from PsiOmegaDelta/150605-Meteors
Ports /tg/'s meteors.
This commit is contained in:
17
code/_helpers/matrices.dm
Normal file
17
code/_helpers/matrices.dm
Normal file
@@ -0,0 +1,17 @@
|
||||
/matrix/proc/TurnTo(old_angle, new_angle)
|
||||
. = new_angle - old_angle
|
||||
Turn(.) //BYOND handles cases such as -270, 360, 540 etc. DOES NOT HANDLE 180 TURNS WELL, THEY TWEEN AND LOOK LIKE SHIT
|
||||
|
||||
|
||||
/atom/proc/SpinAnimation(speed = 10, loops = -1)
|
||||
var/matrix/m120 = matrix(transform)
|
||||
m120.Turn(120)
|
||||
var/matrix/m240 = matrix(transform)
|
||||
m240.Turn(240)
|
||||
var/matrix/m360 = matrix(transform)
|
||||
speed /= 3 //Gives us 3 equal time segments for our three turns.
|
||||
//Why not one turn? Because byond will see that the start and finish are the same place and do nothing
|
||||
//Why not two turns? Because byond will do a flip instead of a turn
|
||||
animate(src, transform = m120, time = speed, loops)
|
||||
animate(transform = m240, time = speed)
|
||||
animate(transform = m360, time = speed)
|
||||
Reference in New Issue
Block a user