-
released this
2023-11-05 01:09:12 -08:00 | 0 commits to main since this release-
Better Init
- There are new and better options for the init function to give a better idea of what is required for a zoomable or normal doodler
- Adds a
minScale
andmaxScale
option for the zoomable canvas - Added a
fillScreen
option to set the canvas size to the full body size- This does require the body to be set to the correct size and not have any margin
- The canvas will automatically resize if the size of the body changes
-
Native animation timing
- Switched to the browser's native
requestAnimationFrame
when a framerate is not provided to the initializer. This improves flickering - Passing a framerate will still function as it did before
- Switched to the browser's native
-
Frame time - the elapsed milliseconds since the last draw call will be passed to each layer's callback
-
2 image animation methods
- GIF: gets timing and frame information from a .gif file. This is inherently limited by the .gif format, including color-depth and framerate
- The
GIFAnimation.draw
method should be called with the frame time that is passed to the layer - Currently no method to arbitrarily draw a frame, but it is planned
- The
- Sprite: the
SpriteAnimation
class requires manual configuration- You must define the width and height of the cells and the cells must all be the same size
- The cells are arranged as a 2 dimensional grid so you must also provide the amount of cells in each row and column
- Timing is determined by a multiplier. The frame counter will increment by
1 * timing
on every draw call. Every whole number it increases by will increase the frame by 1
- Both methods of animation take a scale multiplier property that defaults to 1.
- GIF: gets timing and frame information from a .gif file. This is inherently limited by the .gif format, including color-depth and framerate
-
4 collision detection methods. These should be enough to check collision for just about any shape - lines, arbitrary convex polygons, splines (bezier curve)
- AABB - axis aligned bounding box
- Compares two AABBs to see if they overlap
- Circular
- Compares two circles to see if they overlap. At least one circle should have a radius > 1
- SAT - separation axis theorem
- Can compare arbitrary polygons, circles, and splines
- 4 comparison functions:
satCollisionSpline
,satCollisionPolygon
,satCollisionCircle
, andsatCollisionAABBCircle
- Unless specified, these all compare a polygon to the shape
- AABB to circle comparison is most easily accomplished via SAT.
- Spline-Circle collision is a method on the
SplineSegment
class
- AABB - axis aligned bounding box
-
New geometry classes
SplineSegment
- Defines a spline with the provided vectors
- Includes a lot of utility methods to operate on a spline
Polygon
- Defines an arbitrary polygon using an array of vectors
- Includes some utility methods to operate on a polygon
- Does not currently have vertex ordering to ensure edges do not cross. The vertices provided to the constructor must be in the correct order.
This marks Doodler's first release as a game making toolkit!
Downloads
-