Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main loop #1

Open
ixchow opened this issue Jan 27, 2015 · 0 comments
Open

Main loop #1

ixchow opened this issue Jan 27, 2015 · 0 comments

Comments

@ixchow
Copy link
Owner

ixchow commented Jan 27, 2015

Currently, sald leaves the game developer to worry about creating a main loop. Let's create some reusable code which:

  1. manages a <canvas> tag; including resizing the tag based on demands from the game (e.g. aspect ratio, exact size, integer multiple-of-size)
  2. handles timing and drawing, passing requests to a developer-defined (and changeable) object
  3. grabs input, processes it to be properly canvas-relative, and passes the results to the (developer-defined) scene object

One way we might do this is have a window.scene variable, with (optional) functions draw(), update(elapsedSeconds), key(code, state), down(x,y), motion(x,y), and up(x,y).

@ixchow ixchow changed the title Main Loop Main loop Jan 27, 2015
fgomezfr added a commit to fgomezfr/sald that referenced this issue Feb 5, 2015
tilemap.draw() implementation
ixchow pushed a commit that referenced this issue Feb 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant