Mercurial > hg > Members > tkaito > task_dandy
view mydandy.cc @ 2:6e1afe1016dc
Task is not yet.
author | tkaito |
---|---|
date | Thu, 17 Jun 2010 05:11:29 +0900 |
parents | |
children |
line wrap: on
line source
#include "dandy.h" void shot_move(SceneGraphPtr node, void *sgroot_, int w, int h); void shot_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree); void dandy_move(SceneGraphPtr node, void *sgroot_, int w, int h) { SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; Pad *pad = sgroot->getController(); if (pad->right.isHold() && w > node->xyz[0]) { node->xyz[0] += 10.0f; } else if (pad->left.isHold() && 0 < node->xyz[0]) { node->xyz[0] -= 10.0f; } if (pad->up.isHold() && 0 < node->xyz[1]) { node->xyz[1] -= 10.0f; } else if (pad->down.isHold() && h > node->xyz[1]) { node->xyz[1] += 10.0f; } if (pad->circle.isPush()) { SceneGraphPtr shot = sgroot->createSceneGraph("bluebullet"); shot->set_move_collision(shot_move, shot_coll); shot->xyz[0] = node->xyz[0]; shot->xyz[1] = node->xyz[1] - player_radius; node->addBrother(shot); } } void dandy_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree) { /* SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; SceneGraphIteratorPtr it = sgroot->getIterator(tree); collision_obj(it, node, w, h, sgroot); */ } void shot_move(SceneGraphPtr node, void *sgroot_, int w, int h) { node->xyz[1] -= shot_speed; if (node->xyz[1] < 0) { node->remove(); } } void shot_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree){} void collision_obj(SceneGraphIteratorPtr it,SceneGraphPtr node ,int w, int h, void *sgroot_){}