mini kinda game engine
web https://tripdragon.github.io/infinitesimal-game-engine/
http://localhost:8001/System1/index.html?game=panels
local
python3 -m http.server 8001
A melange on editor and play mode game engine esc tinker sandbox builder
controls are either mouse select, or walk with arrow keys, might have sound, click screen and turn on speakers plus button might do something. top 3 buttons pause game play and step though each frame https://tripdragon.github.io/infinitesimal-game-engine/System1/index.html?game=mousetest https://tripdragon.github.io/infinitesimal-game-engine/System1/index.html?game=superjumpybocky https://tripdragon.github.io/infinitesimal-game-engine/System1/index.html?game=bocky https://tripdragon.github.io/infinitesimal-game-engine/System1/index.html?game=pianoclassical https://tripdragon.github.io/infinitesimal-game-engine/System1/index.html?game=squaresATron_I
webgl view- drag input
- button to make an object
- edit ui viewy
- food
compile to somethingWe do it live!!loopy loop- increase loopy loop
- script based animations from text box
- webgl view!
- text box typing!
- listener poking system!
- lv 1 scripting animations!
- UTZ UTZ UTZ
- AABB box hit collisions
- Keyboard audio sound board
- player movement 2d
- 2d view
- some 3d view
- loop system, for animations and collisions
- live game swapping without reloading
- direct url game loading
so the idea is everything has a lv:n attribute, and the whole box is System1 if something gets a significant upgrade lv:2+ versioning is changed. Nothing complex just a stupid way to track the complexity of the file as it progresses at the start of reading
IF a System2 comes, we freeze everything into the folder and start on a new copy. This way games have compatibility with previous
Right now the basics are. Copy a game from /System1/Discs/...
Rename the game in the Game("n") function
In /System1/index.html
add a copy of the path with import { disc as mousetest } from "./Discs/mousetest.js";
add game to catalog APPPP.addGameToCatalog(mousetest);
you can swap out a default game with APPPP.insertDisc(superjumpybocky);
or you can directly load the game in the url with ?game=name
http://localhost:8001/System1/index.html?game=soundboard
Animation can be had via the main loop hook
this.system.loopHookPoints.beforeDraw = function(){
time functions are not yet fully in so just do deltatime with
mTime = Date.now(); and Date.now() - mTime; mTime = Date.now();
https://webglfundamentals.org/webgl/lessons/webgl-drawing-multiple-things.html
Knowing this a typical WebGL program basically follows this structure
At Init time
create all shaders and programs and look up locations
create buffers and upload vertex data
create textures and upload texture data
At Render Time
clear and set the viewport and other global state (enable depth testing, turn on culling, etc..)
For each thing you want to draw
call gl.useProgram for the program needed to draw.
setup attributes for the thing you want to draw
for each attribute call gl.bindBuffer, gl.vertexAttribPointer, gl.enableVertexAttribArray
setup uniforms for the thing you want to draw
call gl.uniformXXX for each uniform
call gl.activeTexture and gl.bindTexture to assign textures to texture units.
call gl.drawArrays or gl.drawElements
That's basically it. It's up to you how to organize your code to accomplish that task.