LoginSignup
5
6

More than 5 years have passed since last update.

【Cocos2dx 3.0】ゴゴゴゴゴゴゴゴッ

Posted at

NodeやSpriteをゴゴゴゴゴゴ!って上下にぶれながら横に動かす

上下の動き

{
  MoveBy *move0 = MoveBy::create(0.05f, Vec2(0, 5));
  MoveBy *move1 = MoveBy::create(0.05f, Vec2(0, -5));
  RepeatForever *repeat = RepeatForever::create(Sequence::create(move0, move1, NULL));
  obj->runAction(repeat);
}

横へ移動

{
  MoveBy *move = MoveBy::create(2.0f, Vec2(100, 0));
  obj->runAction(move);
}

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6