EDOARDO CASELLA

Freelance web developer


Blog > Duedo - my first 2D game engine

Duedo - my first 2D game engine

Information technology
Posted Mon Nov 15 2021
Updated Thu Feb 17 2022

duedo, html5, canvas

I can't consider myself a strong gamer, but the desire to know how a video game works has always attracted me.

For this reason 5 years ago I started developing a framework, using many existing guides and engines, trying to understand how they work.

Following my first game, I started to take it seriously and I decided to develop my own 2D framework, this would have given me the opportunity to keep updating myself to extend its potential. In other words, I would have been forced to study.

Hence the idea of Duedo, a small framework based on HTML5 canvas that I have not yet documented, but which is giving me great satisfaction.

Why do I decide to speak only now? Some time ago I was asked by a client to develop a small 2D application, the complexity of which required something more than usual HTML and CSS. I immediately took the opportunity to put a suspended project back on its feet, completing it with a physics engine (Box2D) and writing the code for the missing parts. Today Duedo is an almost complete project that I am improving over time.

Among its features:

  1. Sound manager
  2. Can preload and play: mp3, wav, ogg, mp4
  3. Dynamic sounds: you can give a world location to the sound: smanager.Play("soundname").SetLocation(x, y);
  4. Callbacks for every sound playing
  5. Google speech recognition to trigger vocal commands inside your game
  6. Events
  7. Set customized events based on time (like a spaceship that appear every 10 seconds or by a random value)
  8. Give to each element a customizable lifetime
  9. Handle objects temporary modifications
  10. StateManager
  11. Create your own game states (menu, menu2, gameplay, menu3)
  12. Animations
  13. Animate the properties of a graphic object (mysprite.Animate( { prop:val }, time, "Linear"))
  14. Bind customized callbacks to the animations
  15. Input and interactions manager
  16. Keyboard
  17. Mouse
  18. Customizable input properties
  19. Handle pointer events: like dragging or click or pointerover, pointerup ...
  20. Particle System
  21. Spritesheets and image rendering
  22. Geometry and math support
  23. Parallax
  24. Box2D Physics engine
  25. Tilemap: to develop