Skip to content

kiki727/mithrilGameEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geMithril

Mithril as game engine experiment

Main idea is to use master component, and to run loop in it.
Mithril.js use requestAnimationframe to run redraw...

function MasterComponent(){
      return {
      onupdate:(vnode)=>{
        vnode.dom.onclick();// loop
      },
      view:(vnode)=>{
        return m("div.master",{
          onclick:(e)=>{ console.log("loop") }
         },
         [
          Game Objects ...
         ])
      }
   }
 }

This is not canvas based engine, but dom based.

I use css to run sprites.

I find that most perfomant expensive operation is to remove "dead" nodes.

Code is build on fly(in one breath), try to not optimize nothing,
and i write code sloppy (to simulate som load,and bad optimization)... I get average 60fps.

Just download code, and run in browser to see performance...

link to test page

About

Mithril as game engine experiment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published