view dandy.h @ 10:93d9db48775f default tip

Property add not move. 30%
author tkaito
date Mon, 14 Jun 2010 17:20:03 +0900
parents b87dcc11a6d0
children
line wrap: on
line source

#include <math.h>
#include <stdlib.h>
#include "SceneGraph.h"
#include "Application.h"
#include "MainLoop.h"

class dandy : public Application {
  MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
};

typedef void (*move_func)(SceneGraphPtr node, void *sgroot_, int w, int h);
typedef void (*coll_func)(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree);

typedef struct {
	double x, y;
	double vx, vy;
	double angle[3];
	int vit;
	int score;
	move_func move;
	coll_func func;
	SceneGraphPtr parent;
	SceneGraphPtr root;

} *ObjPropertyPtr, ObjProperty;

static const float player_speed = 10.0f;
static const float player_radius = 42.0f;

static const float boss_radius_x = 65.4f;
static const float boss_radius_y = 130.8f;
static const float first_boss1_speed = 10.0;
static const float first_boss1_depth = 500.0;
static const float return_boss1_depth_speed = 10.0;

static const float shot_speed = 30.0f;
static const float shot_radius = 42.4f;

extern void title_collision(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree);
extern void gameover_scene(void *sgroot_, int w, int h);
extern void create_stage(void *sgroot_, int w, int h);