24/02/2022 Added in function getContact(objectID) This returns the items the Object is currently touching.
What is it?? Giftwrap is a thin wrapper or API for Box2D and CSS, to allow new programmers to produce a web game with minimal coding skills using JavaScript.
Examples of games can be found in src/ simply open the HTML files in Chrome for example: breakout.html is the game breakout, and the corresponding breakout.js contains the game code in JavaScript.
The Library itself is in src/scripts, along with dependencies (box2d and jquery)
This work was inspired by the teaching of Dr Russell Hunter of Perth College UHI whose 4th year Web Programming module was awesome!
Box2d is very complex and is difficult to master, so all of the hard work is done for you. All of the things required to draw objects, apply sprites, apply sounds and handle collisions are wrapped up in easy to call functions, no object oriented programming is required. The game design and logic will be all up you.
Simple good looking interactive games can be easily implemented such as:
(In order of difficulty)
Pong
Breakout
Galaga
Frozen Bubble
Asteroids
Giftwrap whilst very functional, could still be considered Alpha. A lot of great functionality is built in, but some Box2d things are not implemented, and some are partially implemented. Because this is vastly simplified, there is a lack of granular control over objects that you would normally have in Box2D.
Bugs have mostly been ironed out, or dealt with in some way, chances are you might well discover one somewhere!
If you really want to develop Box2D games, go and learn Box2D!!
I may consider releasing this on an open source license in the future.