Added gate base.
authorlimb <limb@bc5cbbab-a4ec-0310-bb52-ff3d296db539>
Tue, 14 Nov 2006 19:18:31 +0000 (19:18 +0000)
committerlimb <limb@bc5cbbab-a4ec-0310-bb52-ff3d296db539>
Tue, 14 Nov 2006 19:18:31 +0000 (19:18 +0000)
git-svn-id: svn+ssh://svn/var/repos/curfender@515 bc5cbbab-a4ec-0310-bb52-ff3d296db539

main.cpp

index e62deaa..76668df 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -75,16 +75,18 @@ int draw_object(game_object object, int drawlocation){
       drawlocation=drawlocation+object.speed;
     };
   };
-
-  if(object.active==1){
-    if(object.face==0){
-      mvprintw(object.x,object.y-drawlocation,"%s",object.line0);
-    };
-    if(object.face==1){
-      mvprintw(object.x,object.y-drawlocation,"%s",object.line1);
+  
+  if((object.y-drawlocation>0)and(object.y-drawlocation<79)){
+    if(object.active==1){
+      if(object.face==0){
+       mvprintw(object.x,object.y-drawlocation,"%s",object.line0);
+      };
+      if(object.face==1){
+       mvprintw(object.x,object.y-drawlocation,"%s",object.line1);
+      };
     };
   };
-  
+
   return drawlocation;
 
 }
@@ -138,6 +140,17 @@ int main(){
   player.speed = 0;
   strcpy (player.line0, "<==_>");
   strcpy (player.line1, "<_==>");
+
+  game_object gate;
+  gate.number = 10;
+  gate.active = 1;
+  gate.x = 18;
+  gate.y = 40;
+  gate.direction = 5;
+  gate.face = 1;
+  gate.speed = 0;
+  strcpy (gate.line0, "/|\\");
+  strcpy (gate.line1, "/|\\");
  
   initscr();
 
@@ -171,6 +184,7 @@ int main(){
     score++;
     
     // Draw gate object 10
+    drawlocation = draw_object(gate, drawlocation);
 
     // Draw enemies