Skip to content

sudo-transistor/2DJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2DJS - 2d Javascript engine

2d JS engine via the HTML Canvas API

Features as of now

  • basic grid map generation via 2d array
    • grid row/column units based on length or height of map (grid)
    • for loop tracks 0 (space) or 1 (wall) in map array
    • if 1, pushes a new instance of square geometry to the wall array with its coords
  • delta time animation
  • fixed (target) fps rate
  • classes for different geometries:
    • ray/line
    • circle
    • square
  • collision detection
    • wallCheck(); function (checks for walls)
    • checks via coordinates being equal or not
    • checks for player coords + player radius (player is a circle
  • mouse movement tracking
  • dynamic ray from player to mouse
  • basic player as a blue circle

Features to add

  • triangle class
  • player direction
  • scrolling background
  • CLEAN UP CODE/OPTIMIZE
  • sprites
  • different wall types
  • projectiles
  • enemies
  • CLEAN UP CODE/OPTOMIZE
  • health system
  • items/item pickups
  • inventory system

Future Ideas

  • map editor
    • different wall types
    • enemy spawns
    • light levels
    • item pickums
    • player spawn
  • port game to differnt languages/systems (besides browser)
    • Python via Python Turtle/Pygame
    • C++ via openGL or SDL3
    • mac
    • linux
  • physics engine to expand graphics engine beyond top-down
    • gravity
    • velocity
    • more advanced collision between objects/environment

About

Two dimensional javascript graphics engine via HTML canvas API. No physics yet, but can be implimented. *may be a seperate engine*

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors