Coder Social home page Coder Social logo

spritekit-easing's Introduction

SpriteKit-Easing

Better Easing for SpriteKit!

SpriteKit by default uses the easing curve built by Apple into iOS. While this is an awesome curve to use for UI and more traditional mobile apps game development demands more than 2 functions. The goal of this library is to port a set of standard easing functions into the SpriteKit framework as actions.

SpriteKit-Easing contains the following easing functions:

  • Linear
  • Quadratic
  • Cubic
  • Quartic
  • Quintic
  • Sine
  • Circular
  • Expo
  • Elastic
  • Back
  • Bounce

Usage

The library can directly interact with SKNodes or any Float or Point (for greater compatiblity).

The SKEasing functions generate an action that performs the ease. You can then use / control the action in the same manner you would for any other action in SpriteKit

// Easing the position of a node to a point

SKNode * node = [[SKNode alloc]init];
node.position = CGPointMake(0, 0);

//Add child to scene here
[self addChild:node];

SKAction* action = [SKEase MoveToWithNode:node EaseFunction:CurveTypeSine Mode:EaseIn Time:.5f ToVector:CGVectorMake(100, 100)];

[node runAction:action]

// The rest of the library follows this syntax with the exception of the Float and Point
// Those add a setter that can be used to update a variable of your choice as the action updates

More to come... stay tuned...

Thanks to AHEasing for helping me make sense of this easing nonsense!

spritekit-easing's People

Contributors

bryant1410 avatar buddingmonkey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.