#include "game_object.h"
int draw_object(game_object object, int drawlocation){
- extern int pod_in;
- if(object.number!=pod_in){
- if(object.number==1){
- if((object.y-drawlocation<35) and (object.direction==4)){
- drawlocation=drawlocation-object.speed;
- };
- if((object.y-drawlocation>40) and (object.direction==6)){
- drawlocation=drawlocation+object.speed;
- };
+ if(object.number==1){
+ if((object.y-drawlocation<35) and (object.direction==4)){
+ drawlocation=drawlocation-object.speed;
};
+ if((object.y-drawlocation>40) and (object.direction==6)){
+ drawlocation=drawlocation+object.speed;
+ };
+ };
- int offset = 0;
+ int offset = 0;
- offset = object.y-drawlocation;
+ offset = object.y-drawlocation;
- if(drawlocation>=540&&object.y<620-drawlocation&&object.number!=1){
- offset = 620-drawlocation+object.y; //right of player wrap correction
- };
+ if(drawlocation>=540&&object.y<620-drawlocation&&object.number!=1){
+ offset = 620-drawlocation+object.y; //right of player wrap correction
+ };
- if(drawlocation<0&&object.y>=540&&object.number!=1){
- offset = abs(drawlocation)-abs(620-object.y); //left of player wrap correction
- };
+ if(drawlocation<0&&object.y>=540&&object.number!=1){
+ offset = abs(drawlocation)-abs(620-object.y); //left of player wrap correction
+ };
- if((object.active==1&&object.x>=1&&object.x<=18&&offset>=0&&offset<=79)||((object.number>=200&&object.number<=230)&&(offset>=0&&offset<=79))){
- if(object.face==0){
- mvprintw(object.x,offset,"%s",object.line0);
- } else if(object.face==1){
- mvprintw(object.x,offset,"%s",object.line1);
- } else if(object.face==2){
- mvprintw(object.x,offset,"%s",object.line2);
- } else if(object.face==3){
- mvprintw(object.x,offset,"%s",object.line3);
- } else if(object.face==4){
- mvprintw(object.x,offset,"%s",object.line1);
- mvprintw(object.x-1,offset,"%s",object.line0);
- } else if(object.face==5){
- mvprintw(object.x,offset,"%s",object.line1);
- mvprintw(object.x-1,offset,"%s",object.line0);
- } else if(object.face==6){
- mvprintw(object.x,offset,"%s",object.line3);
- mvprintw(object.x-1,offset,"%s",object.line2);
- };
+ if((object.active==1&&object.x>=1&&object.x<=18&&offset>=0&&offset<=79)||((object.number>=200&&object.number<=230)&&(offset>=0&&offset<=79))){
+ if(object.face==0){
+ mvprintw(object.x,offset,"%s",object.line0);
+ } else if(object.face==1){
+ mvprintw(object.x,offset,"%s",object.line1);
+ } else if(object.face==2){
+ mvprintw(object.x,offset,"%s",object.line2);
+ } else if(object.face==3){
+ mvprintw(object.x,offset,"%s",object.line3);
+ } else if(object.face==4){
+ mvprintw(object.x,offset,"%s",object.line1);
+ mvprintw(object.x-1,offset,"%s",object.line0);
+ } else if(object.face==5){
+ mvprintw(object.x,offset,"%s",object.line1);
+ mvprintw(object.x-1,offset,"%s",object.line0);
+ } else if(object.face==6){
+ mvprintw(object.x,offset,"%s",object.line3);
+ mvprintw(object.x-1,offset,"%s",object.line2);
};
-
};
return drawlocation;