This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for in_file in $(ls -1 *.wav) | |
| do | |
| out_file="fade/${in_file}.wav" | |
| echo "Processing: \"$in_file\". Saving as \"$out_file\" ..." | |
| sox "$in_file" "$out_file" fade t 0 0 2 | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| auto item1 = MenuItemLabel::create(LabelTTF::create("[$200]", "Courier New.ttf", 51), | |
| [](Object *obj) { | |
| CCLOG("item1 touched"); | |
| }); | |
| auto item2 = MenuItemLabel::create(LabelTTF::create("[$500]", "Courier New.ttf", 51), | |
| [](Object *obj) { | |
| CCLOG("item2 touched"); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| auto explosion = ParticleSystemQuad::create("explosion.plist"); | |
| explosion->setAnchorPoint(Point::ANCHOR_MIDDLE); | |
| explosion->setPosition(Point(200, 200)); | |
| explosion->setAutoRemoveOnFinish(true); | |
| addChild(explosion); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // in a layer initialize method such as the onEnter | |
| auto listener = cocos2d::EventListenerTouchOneByOne::create(); | |
| listener->onTouchBegan = [](Touch *, Event *) { | |
| // do something | |
| return true; | |
| }; | |
| listener->onTouchMoved = [](Touch* touch, Event* event) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Size size = Size(128, 128); | |
| auto frames = new Vector<SpriteFrame *>(); | |
| for (int x = 0; x <= 10; ++x) { | |
| auto rect = Rect(x * size.width, 0, size.width, size.height); | |
| auto frame = SpriteFrame::create("walkingZombieSprite.png", rect); | |
| frames->pushBack(frame); | |
| } | |
| auto animation = Animation::createWithSpriteFrames(*frames); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| auto jump = JumpBy::create(0.5, Point(0, 0), 100, 1); | |
| auto callback = CallFunc::create([](){ | |
| CCLog("Jumped!"); | |
| }); | |
| auto seq = Sequence::create(jump, callback, NULL); | |
| sprite->runAction(seq); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * The problem is the damage effect that changes boundingBox while detecting collision. | |
| * To detect collision correctly, We need to make lists of collided sprites. | |
| * | |
| * Character Class inherited Node and implemted onCollision method. | |
| * | |
| * class Character: public Node { | |
| * public: | |
| * onCollision(Vector<Character *> *characters); | |
| * } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| touch -cm ${SRCROOT}/../Resources/src | |
| touch -cm ${SRCROOT}/../Resources/res |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ___FILENAME___ | |
| // ___PROJECTNAME___ | |
| // | |
| // Created by ___FULLUSERNAME___ on ___DATE___. | |
| //___COPYRIGHT___ | |
| // | |
| #include "___FILEBASENAME___.h" |
OlderNewer