GithubHelp home page GithubHelp logo

jacobgardner / hack-and-slash Goto Github PK

View Code? Open in Web Editor NEW

This project forked from github/game-off-2016

0.0 0.0 1.0 117 KB

Hack & Slash: Sidescroller

Home Page: https://jacobgardner.github.io/hack-and-slash/

JavaScript 96.22% CSS 1.72% HTML 2.07%

hack-and-slash's People

Contributors

jacobgardner avatar jrhii avatar leereilly avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ryodo102

hack-and-slash's Issues

Build level scene type

Whatever format we use for the level will be fed into this. This will then generate all the necessary entities based on that input. This includes:

  • The player entity
  • Enemies
  • Platforms
  • Background
  • Whatever else is necessary for a level

Build viewport object

Maybe this doesn't need to be an object. Probably just a function. What I'm imagining is something that looks like:

newViewport = adjustViewport(prevViewport, levelBounds, importantEntities);

So the player will always be in importantEntities and so what I'm imagining is that if the player gets close to the left or right side of the screen, the camera/viewport will move. It will only move as far as the levelBounds though. If multiple importantEntities are passed in, then the camera should try to keep both in view as best as possible.

This may include zooming out and stuff. There should also probably be some sort of smoothing factor so if an entity is added, the camera doesn't just SNAP to include both entities.

Build Scene Object

The renderer should be fed a scene object which is actually what controls what's being rendered. We'll probably only have one scene type (a level), but possibly will have multiple scenes (multiple levels).

Scenes could be used for Menus, Levels, Credits, etc. Anything where the context is completely different for the renderer.

A level scene will be responsible for rendering hud elements, the background, and level entitites.

class Renderer {
  draw() {
    preDraw()
    currentScene.draw();
    postDraw();
  } 
}

We'll probably have to move some of the stuff that's currently in renderer into the scene object, like scaling the units to be 20 high. This way units n' stuff are specific to a scene type and not universal.

Build physics collider engine

My idea for this is to make all movement work by placing a velocity on entities, which show the direction you want the entity to move. The physics 'engine' will resolve the vector and determine if the movement was valid or not, then updating the movements accordingly. Might be the wrong way to approach this.

Build player entity

This will be what eventually gets hooked up to inputs, will be the source of information for the hud, and be the primary object that the physics engine will be keeping track of.

Things to consider:

  • Only can jump when not falling (unless double jumps)

Build more advanced viewport

For this I'm imagining the player running in a direction, then as they approach an enemy, the viewport gets larger (shows more area), and the player starts to get centered in the view, revealing the enemy in an adequate amount of time to react. Or maybe only for bosses n' such.

Build Base Entity Object

This should be the base class that all other entity types inherit from.

The things that I think all entities should have are probably:

  • position
  • bounding box?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.