A disgusting little race condition has appeared, running will result in a black screen 70% of the time >:( TODO: lambda functions referencing non static graphics methods instead of making graphics methods static state manager (everything is hodge podged into graphics and pycron objects) sort math functions into relevant places (trig, random etc)
28 lines
594 B
C++
28 lines
594 B
C++
#pragma once
|
|
#include <algorithm>
|
|
#include "pocketpy.h"
|
|
#include "Graphics/Graphics.h"
|
|
|
|
class Pycron {
|
|
|
|
private:
|
|
const int virtualScreenWidth = 360;
|
|
const int virtualScreenHeight = 203;
|
|
const int initialScale = 3;
|
|
Graphics* graphics;
|
|
pkpy::VM* vm;
|
|
|
|
public:
|
|
Pycron();
|
|
~Pycron();
|
|
|
|
void StartGameLoop();
|
|
void bindMethods(pkpy::VM* vm);
|
|
|
|
static pkpy::PyObject* getRandomNumber(pkpy::VM* vm, pkpy::ArgsView args);
|
|
static pkpy::PyObject* getSin(pkpy::VM* vm, pkpy::ArgsView args);
|
|
static pkpy::PyObject* getCos(pkpy::VM* vm, pkpy::ArgsView args);
|
|
|
|
};
|
|
|