Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from __future__ import division

import sys
import math
import random
import time
Expand Down Expand Up @@ -30,6 +33,9 @@

PLAYER_HEIGHT = 2

if sys.version_info[0] >= 3:
xrange = range

def cube_vertices(x, y, z, n):
""" Return the vertices of the cube at position x, y, z with size 2*n.

Expand Down Expand Up @@ -116,7 +122,7 @@ def sectorize(position):

"""
x, y, z = normalize(position)
x, y, z = x / SECTOR_SIZE, y / SECTOR_SIZE, z / SECTOR_SIZE
x, y, z = x // SECTOR_SIZE, y // SECTOR_SIZE, z // SECTOR_SIZE
return (x, 0, z)


Expand Down Expand Up @@ -761,7 +767,7 @@ def on_resize(self, width, height):
# reticle
if self.reticle:
self.reticle.delete()
x, y = self.width / 2, self.height / 2
x, y = self.width // 2, self.height // 2
n = 10
self.reticle = pyglet.graphics.vertex_list(4,
('v2i', (x - n, y, x + n, y, x, y - n, x, y + n))
Expand Down