You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor creating window to only return the window object (not WindowPtr and EclipseWindow)
Attach renderer and former windowptr to the window object
reduce reliance on SDL2 types, use our own
reduce checking for == nil / != nil (when using SDL2 / return types), use Option[]
rename procs for GameEvent
Changes
Change the base class for everything to be GameObject (scenes, ui components, etc are now a GameObject)
GameObject stores components, a UID, and a name for the game object
GameObject have to be manually create(), and then added to a scene allowing for reusability and cloning; the "original" is never used. (think of it like Godot; you have objects but you can put an infinite amount of a single object in a Node, each holding their own values and running their own scripts: thats the structure I want to move towards)
change ComponentProc to be proc (o: GameObject) instead of proc (c: Component) for more versatility and use
[x ] Add object class SpriteObject class (of GameObject)
Remove old hardcoded movement code, move to game logic rather than engine
Add "Attribute" Class, attachable to game objects for adding more data to them, as an alternative to using variables
addAttribute(attName: string, attValue: T) Raises if attribute not found, or T is invalid
getAttribute(attName: string): Option[T] Returns either some() or none()
setAttribute(attName: string, newAttValue: T) Raises if attribute not found, or T is invalid
removeAttribute(attName: string): Raises if attribute not found
T can be: string, int, bool, Vector2; potentially more
New procs for GameObject:
destroy(o: GameObject) -- Removes the game object instance, and all associated components / attributes
Add GameEvents to GameObject:
onCreate -- run when the entity is created
onDraw -- run when drawn
onUpdate -- run during updating
onDestroy -- Before its destroyed, could in theory delay destruction
Make Once() return a different event connection type (GameEvent)
Add support for passing parameters through GameEvent.Fire()
Change InputKey and MouseKey Enums to follow Nim Style
also rename MouseKey to MouseButton
make InputManager handle polling of events, along with auto conversion and as such only requiring the manager to be updated
Add support for window flags (Window Flags: an optional seq of flag enums that gets converted into SDL2 window flags)
Game changes:
when initalising, add a GameEvent
add overrideable Game.init proc for adding initialisation for the game (think function love.load())
add overrideable Game.update proc for updating parts (love.update())
overrideable Game.draw proc for drawing
Removals (undecided if temp or perm)
Remove Deactivate() from GameEvent
Un-export sdl2
Temp removals:
Remove SceneUI
Revert to old UI code
Potential changes
Migrate to SDL3 (nsdl3 OR nim-sdl3)
Neither have support for SDL_ttf or SDL_image
nsdl3 has weird conventions
nim-sdl3 requires a ton of extra manual work (which, while it can be implemented into things like beginFrame/endFrame/close/run, is a lot more tedious)
OR:
Migrate systems to use OpenGL over SDL2
more modern, consistently updated
more work needed for "simple" things, but less SDL2-isms.
refactor
== nil/!= nil(when using SDL2 / return types), useOption[]GameEventChanges
Change the base class for everything to be
GameObject(scenes, ui components, etc are now a GameObject)GameObjecthave to be manuallycreate(), and then added to a scene allowing for reusability and cloning; the "original" is never used. (think of it like Godot; you have objects but you can put an infinite amount of a single object in a Node, each holding their own values and running their own scripts: thats the structure I want to move towards)change ComponentProc to be
proc (o: GameObject)instead ofproc (c: Component)for more versatility and use[x ] Add object class
SpriteObjectclass (ofGameObject)Remove old hardcoded movement code, move to game logic rather than engine
Add "Attribute" Class, attachable to game objects for adding more data to them, as an alternative to using variables
addAttribute(attName: string, attValue: T)Raises if attribute not found, or T is invalidgetAttribute(attName: string): Option[T]Returns either some() or none()setAttribute(attName: string, newAttValue: T)Raises if attribute not found, or T is invalidremoveAttribute(attName: string): Raises if attribute not foundTcan be:string,int,bool,Vector2; potentially moreNew procs for GameObject:destroy(o: GameObject)-- Removes the game object instance, and all associated components / attributesAdd GameEvents to GameObject:
onCreate-- run when the entity is createdonDraw-- run when drawnonUpdate-- run during updatingonDestroy-- Before its destroyed, could in theory delay destructionMakeOnce()return a different event connection type (GameEvent)Add support for passing parameters through
GameEvent.Fire()Change
InputKeyandMouseKeyEnums to follow Nim StyleMouseKeytoMouseButtonmake
InputManagerhandle polling of events, along with auto conversion and as such only requiring the manager to be updatedAdd support for window flags (
Window Flags: an optional seq of flag enums that gets converted into SDL2 window flags)Gamechanges:GameEventGame.initproc for adding initialisation for the game (thinkfunction love.load())Game.updateproc for updating parts (love.update())Game.drawproc for drawingRemovals (undecided if temp or perm)
Deactivate()fromGameEventsdl2Temp removals:
Revert to old UI codePotential changes
OR: