Advertisement
bynaki

JumpBy

Mar 4th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. bool HelloWorld::init()
  2. {
  3.     if (!Layer::init())
  4.     {
  5.         return false;
  6.     }
  7.  
  8.     auto spr = Sprite::create("ball.png");
  9.     spr->setPosition(Point(50, 50));
  10.     this->addChild(spr);
  11.  
  12.     // 5.0초 동안, (300, 0) 상대적 거리로, 150높이, 5번 점프.
  13.     auto action = JumpBy::create(5.0, Point(300, 0), 150, 5);
  14.     // 객체에 지정된 액션을 바로 실행한다.
  15.     spr->runAction(action);
  16.  
  17.     return true;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement