DISCLAIMER: I've never made a beat em up game before.
I wanted to go through and figure things out before I write the tutorial. (Makes sense right?)
I've got a decent start on things so far.
Not really a bug, but a feature: At this time the player cannot jump. And I'm probably going to keep things that way so I don't have to go animate and render additional sprite frames. 😜
There is still a lot for me to figure out here, but it's off to a good start. My next focus is probably going to be throwing in destructible objects (The crate & trashcan seen in the last post) which will require a collision detection system, among other things.
Stay tuned for more game programming adventures!
I wanted to go through and figure things out before I write the tutorial. (Makes sense right?)
I've got a decent start on things so far.
- The solid white square is the X and Y of the player entity.
- The hollow white square is the bounds of the player sprite's actual raster image buffer.
- The orange horizontal line is the center Y level of the player
- The blue vertical line is the center X of the player
- The cyan vertical lines are quarter divisions used to place the collision hitboxes when facing left or right.
- The green rectangle is the hitbox of the player which will receive damage. It's size and placement changes based on the current animation.
- There are 2 red hitboxes which are the damage-dealing hitboxes that will be used to tell when the player punches or kicks something.
- Ignore the crazy continuously animated guy. That was a test entity that I was using to test the animation engine that I built.
What you see above is the result of about a day of coding without any references. And comprised of the following classes:
- Actor
- AnimatedSprite
- Animation
- AnimationSequence
- AnimationTrigger
- Backdrop
- Entity
- Input
- Keyboard
- Player
- Stage
- Ticker
I am building things in a modular and reusable fashion. I'll probably release the "engine" separately so that it can drive other projects easily.
Features I've built here so far are:
- Basic 2D depth-sorted sprite rendering engine using HTML5 Canvas API
- Simple audio playback system using HTML5 Web Audio API
- 2D frame-based sequenced sprite animation engine
- Handles Keyboard input
There are lots of bugs still, like the background shifting off the screen when I walk left. Early camera system needs to be completely rewritten. The animation sequencer currently cannot handle linking the same animation together. So I gotta solve why that is.
Not really a bug, but a feature: At this time the player cannot jump. And I'm probably going to keep things that way so I don't have to go animate and render additional sprite frames. 😜
There is still a lot for me to figure out here, but it's off to a good start. My next focus is probably going to be throwing in destructible objects (The crate & trashcan seen in the last post) which will require a collision detection system, among other things.
Stay tuned for more game programming adventures!
Comments
Post a Comment