Skip to content

Instantly share code, notes, and snippets.

@johngirvin
Created January 8, 2016 13:39
Show Gist options
  • Save johngirvin/fa0e7176219ba57b18da to your computer and use it in GitHub Desktop.
Save johngirvin/fa0e7176219ba57b18da to your computer and use it in GitHub Desktop.
#ifndef __BUNNYMARK_SCENE_H__
#define __BUNNYMARK_SCENE_H__
#include "cocos2d.h"
USING_NS_CC;
typedef struct {
float x,xv,y,yv,r,rv;
Sprite *sprite;
} Bunny;
class BunnyMarkScene : public Scene
{
public:
CREATE_FUNC(BunnyMarkScene);
virtual bool init();
virtual void onEnter();
virtual void onExit();
virtual void update(float dt);
private:
float minX = 0;
float maxX = 0;
float minY = 0;
float maxY = 0;
float fpsTime;
float fpsCount;
Sprite *bunnySprite;
std::vector<Bunny> bunnies;
int randomInt(int min, int max);
void initBunny(Bunny *bunny);
void moreBunnies(int more);
};
#endif // __BUNNYMARK_SCENE_H__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment