Files
dusk/tools/editortool/map/tile.py
Dominic Masters c874e6c197
All checks were successful
Build Dusk / build-linux (push) Successful in 47s
Build Dusk / build-psp (push) Successful in 1m6s
Fixed some stuff, procrastinating the real problem
2025-11-16 16:18:01 -06:00

29 lines
693 B
Python

from OpenGL.GL import *
from editortool.map.mapdefs import TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH
class Tile:
def __init__(self):
self.tile_id = 0
def draw(self, x, y, z):
w = TILE_WIDTH
h = TILE_HEIGHT
d = TILE_DEPTH
x = x * w
y = y * h
z = z * d
# Center tile.
x -= w / 2.0
y -= h / 2.0
z -= d / 2.0
# Draw the tile as a flat square on the X-Y plane at depth z.
glColor3f(1.0, 0.0, 0.0) # Red color
glBegin(GL_QUADS)
glVertex3f(x, y, z) # Bottom-left
glVertex3f(x + w, y, z) # Bottom-right
glVertex3f(x + w, y + h, z) # Top-right
glVertex3f(x, y + h, z) # Top-left
glEnd()