Castle
play2.8k
20
9 Comments
Next up
Give me your juicy ides #givemeideas
Add this to your ball place the script in the script. -- Squish effect: stretch toward the touch by projecting deformation onto x/y axes. -- No rotation is used, which means no spinning can ever occur. local BASE_W = 2 local BASE_H = 2 local STRETCH = 2.4 -- how much to elongate along the touch axis local SPRING_K = 150 -- stiffness (higher = snappier) local DAMPING = 8 -- damping (lower = more bouncy/wobbly) local cW, cH -- current width/height spring position local vW, vH -- spring velocities function onCreate() BASE_W = my.layout.widthScale BASE_H = my.layout.heightScale cW, cH = BASE_W, BASE_H vW, vH = 0, 0 my.layout.rotation = 0 end function onUpdate(dt) -- Find a touch currently on this ball local touched = false local touchAngle = 0 for _, touch in ipairs(castle.getTouches()) do for _, actor in ipairs(castle.getActorsAtTouch(touch.id)) do if actor == my then local dx = touch.x - my.layout.x local dy = touch.y -
fire1Reply
Ive got some ideas: -animate with your oc (doing activiteis or something) -animate an old or New popular meme -animate something you like or love (like an idol of yours)
fire2Reply
Cerealkiller, I thought you were a square girl smiling with the cube dash on your profile.
fire2Reply
-- Squish effect: stretch toward the touch by projecting deformation onto x/y axes. -- No rotation is used, which means no spinning can ever occur. local BASE_W = 2 local BASE_H = 2 local STRETCH = 2.4 -- how much to elongate along the touch axis local SPRING_K = 150 -- stiffness (higher = snappier) local DAMPING = 8 -- damping (lower = more bouncy/wobbly) local cW, cH -- current width/height spring position local vW, vH -- spring velocities function onCreate() BASE_W = my.layout.widthScale BASE_H = my.layout.heightScale cW, cH = BASE_W, BASE_H vW, vH = 0, 0 my.layout.rotation = 0 end function onUpdate(dt) -- Find a touch currently on this ball local touched = false local touchAngle = 0 for _, touch in ipairs(castle.getTouches()) do for _, actor in ipairs(castle.getActorsAtTouch(touch.id)) do if actor == my then local dx = touch.x - my.layout.x local dy = touch.y - my.layout.y touchAngle = math.atan2(dy, dx) --
fire1Reply
Animate a lemon being squeezed
fire1Reply
you play a ball
fire1Reply