Compare commits

...

2 Commits

Author SHA1 Message Date
914ad5e0ce Created a pi(e) in literally 10 minutes, I'm fucking balling lads 2025-06-25 14:48:03 +01:00
9643baa093 Updated game details 2025-06-25 14:47:42 +01:00
3 changed files with 22 additions and 5 deletions

18
game.py
View File

@ -1,8 +1,11 @@
import math as maths
import logging import logging
import pygame import pygame
import gameUtils import gameUtils
import NoPELib import NoPELib
import numpy as np
class Game(gameUtils.Game): class Game(gameUtils.Game):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
""" """
@ -17,6 +20,19 @@ class Game(gameUtils.Game):
# Don't remove this. It does important things. :3 # Don't remove this. It does important things. :3
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.wheelSurf = pygame.Surface([min(self.size)]*2) # Don't ask.
items = [f'Example item {i+1}' for i in range(10)]
circleR = self.wheelSurf.size[0] / 2
pygame.draw.circle(self.wheelSurf, (100, 100, 100), (circleR, circleR), circleR)
for idx, item in enumerate(items):
scaledIdx = (idx / len(items)) * maths.pi * 2
vector = maths.cos(scaledIdx), maths.sin(scaledIdx)
endPos = np.add(np.multiply(vector, circleR), circleR)
pygame.draw.line(self.wheelSurf, (255, 255, 255), (circleR, circleR), endPos)
def onEvent(self, event): def onEvent(self, event):
""" """
Ran when an event is fired. Ran when an event is fired.
@ -31,7 +47,7 @@ class Game(gameUtils.Game):
Ran once per frame, put your drawing code and any Ran once per frame, put your drawing code and any
game logic that should be ran once per frame in here. game logic that should be ran once per frame in here.
""" """
pass self.surf.blit(gameUtils.centre(self.wheelSurf, self.size), (0, 0))
def close(self): def close(self):
""" """

View File

@ -1,8 +1,8 @@
# The ID used for logging # The ID used for logging
# TODO: Filter things like '\', '{}', '\n' etc.- # TODO: Filter things like '\', '{}', '\n' etc.-
id = "changeMe" id = "spinTheSin"
# The name used for setting the windows # The name used for setting the windows
# title, and for displaying in the launcher # title, and for displaying in the launcher
name = "Change me" name = "Spin The Sin"
# The description displayed by the launcher # The description displayed by the launcher
description = "Write something about this game.\nNew lines are supported." description = "Write something about this game.\nNew lines are supported."

View File

@ -2,3 +2,4 @@
../NoPELib/ ../NoPELib/
../PDOLib/ ../PDOLib/
pygame-ce pygame-ce
numpy