Exemplo n.º 1
0
static sprite_t *create(void * owner)
{
	sprite_t *s;
	player_t *p = (player_t *)owner;
	CRITICAL(s = calloc(1,sizeof(struct biplane)));
	s->owner=owner;
	p->damage=(100*((mech_sprite_t *)s)->damage)/hitpoints;
	if(strcmp(s->owner->name, "nyan-cat\0")==0 || strcmp(s->owner->name, "Nyan-cat\0")==0 ){
		printf("Nya nya Nyaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaan\n");
		s->animation = right_anim[MAXTEAMS][0];
		s->owner->schrodinger=1;
	}else{
		s->owner->schrodinger=0;
		s->animation = right_anim[s->owner->team->id][s->owner->id_in_team];//TODO hack numéro
	}
	s->anim_p = 32;

	mech_defaults((mech_sprite_t *)s,MECH_CANROTATE);
	((struct biplane *)s)->bullet_type = •
	((struct biplane *)s)->nr_bombs = nr_bombs;
	((mech_sprite_t *)s)->rmass = 1/mass;
	((mech_sprite_t *)s)->gravity = mass;
	((mech_sprite_t *)s)->angle = 128;

	((mech_sprite_t *)s)->air_isotropic = air_isotropic;
	((mech_sprite_t *)s)->air_turnrate = air_turnrate;
	((mech_sprite_t *)s)->air_normal = air_normal;
	return s;
}
Exemplo n.º 2
0
static sprite_t *create(void)
{
	sprite_t *s;
	s = obj_alloc(sizeof(mech_sprite_t), &draco.object_type);
	mech_defaults((mech_sprite_t *)s);
	((mech_sprite_t *)s)->rmass = 0.2;
	((mech_sprite_t *)s)->gravity = 0.1;
	s->flags |= SPRITE_PAUSED;
	s->state = DRACO_GLIDE;
	s->animation = anim;
	return s;
}