I added coin system to my horizontal runner game. I can collect coins without animation, everything is ok but… I want to show an effect when a coin is collected.
So I made this sprite sheet which has 3 textures (collected.png):
I tried adding animation to my game but it crashes when I collect a coin. The animation doesn’t run. Let me copy a few parts of my code here.
Below code is inside “HelloWorldScene.cpp” and it calls after all textures loaded in loading screen.
oh you say game crashes in the title of this thread.
So if is it freezing, are you testing on actual hardware or in an emulator? If an emulator, please try on hardware. Emulators are not always representative of how your game will run on devices.
I’m testing on the phone (S6 Edge). My computer can’t run x86 emulator (it says intel haxm bla bla bla) and runs ARM emulator very slow. So I’m testing on phone.
When I disable this line in CoinGroup::removeCoin function, the game keeps running but the animation doesn’t play, only first frame appears:
sprAnim->runAction(Animate::create(animation));
I think it’s a problem with animation variable. Do I have to retain the animation or something?
yes, but “proj.android_studio” folder is 1.7 GB and I think it takes too much time to upload it. proj.android-studio\app\build\intermediates\ndkBuild\debug this path contains 1.5GB. i don’t know why it’s too much. which folders should i upload?