Commits

Pierre Surply committed 18af75e

Modif perspective

  • Participants
  • Parent commits 9f3828c

Comments (0)

Files changed (4)

File res/img/floor.png

Old
Old image
New
New image

File res/img/lvl_elts.png

Old
Old image
New
New image
 ##    along with BASIC-RoBots.  If not, see <http://www.gnu.org/licenses/>. 
 ##
 ## Started on  Thu Jun 28 13:22:05 2012 Pierre Surply
-## Last update Mon Aug 27 16:39:56 2012 Pierre Surply
+## Last update Mon Aug 27 19:37:59 2012 Pierre Surply
 ##
 
 import os
     def __init__(self, path, biome, (x, y), events):
         self.set_display_list()
         self.init_tile()
+        self.angle = 0
         self.robots = []
         self.running_robot = 0
         self.biome = biome
         glMatrixMode(GL_PROJECTION)
         glPushMatrix()
         glLoadIdentity()
-        gluPerspective(80, cam_w/cam_h,1,64)
+        gluPerspective(40, cam_w/cam_h,1,64)
         glEnable(GL_DEPTH_TEST)
         glEnable(GL_ALPHA_TEST);
         glAlphaFunc(GL_GREATER, 127.0/255.0);
         glMatrixMode(GL_MODELVIEW)
         glLoadIdentity()
 
-        gluLookAt(-3, 5, 10,\
+        gluLookAt(-2, 6, 10,\
                       0, 0, 0, \
                       0, 0, 1)
+        glRotated(self.angle, 0, 0, 1)
 
         z = self.temp_tiles[self.tile[select_x][select_y]][3] + 0.1
         glBindTexture(GL_TEXTURE_2D, self.cursor)
         glPopMatrix()
         glTranslated(-select_x-0.5-dx, -select_y-0.5-dy, 0);
 
-        for y in range(max(select_y-16, 0), min(select_y + 10, self.size)):
-            for x in range(max(select_x-9, 0), min(select_x + 16, self.size)):
+        for y in range(max(select_y-7, 0), min(select_y+8, self.size)):
+            for x in range(max(select_x-6, 0), min(select_x+10, self.size)):
                 self.render_case(x, y)
                 if self.tile_elts[x][y] != None:
                     self.render_elt(x, y)
 ##    along with BASIC-RoBots.  If not, see <http://www.gnu.org/licenses/>.
 ##  
 ## Started on  Thu Jun 28 15:31:47 2012 Pierre Surply
-## Last update Mon Aug 27 12:36:49 2012 Pierre Surply
+## Last update Mon Aug 27 18:44:15 2012 Pierre Surply
 ##
 
 import pygame
             self.env.render((self.select_x, self.select_y, \
                                      display.window.get_width(), \
                                      display.window.get_height()), \
-                                (3, 1))
+                                (2, 1))
             display.render_terminal()
         else:
             self.handle_events(events)
 
     def handle_events(self, events):
         if events.get_key_once(K_RETURN):
+            self.env.angle = 0
             for i in range(len(self.env.robots)):
                 if self.env.robots[i].get_pos() == (self.select_x, \
                                                       self.select_y):
                     self.select_robot = i
                     self.events.rec_char = True
         if events.key[K_LCTRL]:
+            if events.key[K_r]:
+                self.env.angle += 1
             arrows = (events.key[K_UP], \
                           events.key[K_DOWN],\
                           events.key[K_LEFT],\
             self.select_x -= 1
         if arrows[2] and self.select_x < self.env.size-1:
             self.select_x += 1
+        
 
     def incr_select_robot(self, incr):
         self.events.rec_char = True