jacobgardner / hack-and-slash Goto Github PK
View Code? Open in Web Editor NEWThis project forked from github/game-off-2016
Hack & Slash: Sidescroller
Home Page: https://jacobgardner.github.io/hack-and-slash/
This project forked from github/game-off-2016
Hack & Slash: Sidescroller
Home Page: https://jacobgardner.github.io/hack-and-slash/
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:
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.
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.
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.
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:
I am having syntax error issues that seem to stem from using es6's import
statement. Am I missing an unlisted dependency?
Also, are babel-preset-es2015
and eslint
dependencies that need to be installed?
HUD should contain, for now, a player health bar.
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.
This should be the base class that all other entity types inherit from.
The things that I think all entities should have are probably:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.