A simple Javascript/jQuery framework to allow the quick creation, deployment, and expansion of incremental games.
[This project uses the MIT License]
v1.6 Tutorial 1 --> NEW
Descent: A v1.5.1 Simple Survival Game Demo
The goal of this is to create a very simple-to-use javascript framework for other incremental-game enthusiasts! I've often seen many people online who would like to embark upon their own ventures but lack either the time or skills to get some of the boring stuff out of the way.
So this is the purpose of the engine: get the boring stuff out of the way and onto the fun stuff!
-
js/incrementalObject.js -> The main file
-
js/jquery.js -> jQuery file used.
-
documentation.html -> page with documentation on methods. It's still a work-in-progress but helps to gain an idea of what's going on in each object.
- js/ParticleObject.js -> Just a simple particle script I made for the background stars. I was building the game engine on top of another project and so this is just a nice (visually appealing) artefact. Not required at all.
- css/incremental_style.css -> The CSS of the demo
- css/fonts/NewCircle/ -> The font I'm using for the demo page
- index.html -> The Demo Page
- css/incremental_demo_style.css -> The css of the v1.2 demo.html
- tutorials/ -> contains tutorials
- EntityExample.html -> very simply example of using an EntitySet and Entity independently and together
- demo_survival.html -> A simple demo with some basic survival elements demonstrating the creation of a game with v1.5.1 of this library.
-
Documentation is live! Check the link above.
-
While it was planned that jQuery would be removed to make this a vanilla JS library, jQuery has more than simplified certain sections of the code to avoid further unnecessary code. As a result, jQuery will continue to be used for DOM and DOM Events manipulation. A vanilla JS version will also be provided once we have all core features implemented.
-
Supplementing Trackers using Timers -> Additional (optional) parameter to all tracker functions that will execute a function if a certain value is reached. (DONE in a way -> Can be taken care of using the optional third argument in Common.track())
-
Saving/Loading - attempted earlier but ran into unexpected trouble. Will reattempt soon.
-
UI (User Interface) and other related helper functions to help streamline creation of dynamic page elements.
-
Allow the definition of 'required and default attributes' for all Entities of an EntitySet -> essentially giving EntitySets 'types'.
-
Add multiple attributes using add/setAttribute (DONE -> updateAttributes)
-
Add a getRandomEntity() function that does exactly that.
-
Add the ability to give max/default/minimum values for attributes (similar to 4).
-
Add a game.stop() or game.pause() or equivalent
As of v1.6
- Add clicker text over a specific element, not just the mouse
- Add hover events, not just clickers
- Options for Game()
- Shorthands for functions **DONE5. Add a "updateAttributes" function that takes in an object of n_attributes and updates/adds attributes accordingly
- Get Tracks to update a value as soon as it changes, not just until the next loop
###v1.6 [Jan 9, 2015]
- Common and AttributeSet now have an "updateAttributes(n_attributes)" function that allow multiple attributes to be added/updated through an object
- Tracks now only update if there is an actual change in value.
- Default FPS is now 1.
- AttributeSet.addAttribute and Common.addAttribute now takes an extra, optional, 4th parameter called 'func', same in functionality as track()'s func parameter.
- Added a Common.getAttributesOriginal() function which returns the attributes themselves, as opposed to copies like in getAttributes, but ALSO includes the AttributeSet prototype methods
- Added track and untrack functions to AttributeSet as well in case one only wants to use AttributeSet and nothing else
- Game.addFlag(..) console logging has been removed.
- MIT License added. Sorry it took so long!
###v1.5.1 [Jan 6, 2015]
- First update of the year - nothing too great. Just a minor change to the way addClickerText works.
- Flags are now logged in the console for testing purposes (will be removed in 1.6).
###v1.5 [Dec 29, 2014]
- Added Game.addFlag(), Game.removeFlag(), Game.checkFlag(), which allows one to store and track particular events/milestones/progress.
- Added Game.addClickerText(), which adds text to the mouse's current position and moves it upwards for a second.
- Modified Game.addClicker() to handle dynamic HTML elements.
- Modified Common.track() to receive an optional third argument - a function, which takes one parameter (the value of the attribute being tracked), and should return the way that parameter must be displayed.
###v1.4 [Dec 26, 2014]
- Game.play() function now handles missed frame execution (i.e. when game runs in background tab and interval time is throttled).
- Added Game.addTimer(func, options) that executes a function during the game loop based on timer options passed (once, 'x' times, continuous..etc)
- Fixed bug that didn't add attributes of an entity correctly when an entity was passed to EntitySet.addEntity().
- Fixed bug that didn't add the name correctly to a new entity when another entity was added to a set.
###v1.3.1 [Dec 26, 2014]
- Fixed bug that resulted in incorrect results when checking whether an Entity Name existed through addEntity(...,...)
- Return the AttributeSet itself instead of the value in add/setAttribute.
- Modified Game.addClicker() to make the params of the function passed optional.
- Documentation page created using EntitySet/Entities/AttributeSet.
###v1.3 [Dec 25, 2014]
- Added Game.addClicker(id,functionToExecute,[params,for,function]) and Game.removeClicker(id) which allows any html element (denoted in id by #id or .class ..etc) to become a clicker for a function.
- Added Game.play(function that needs to be played in the game loop) which runs the game loop function passed 'Game.getFPS() times per second'.
- Added EntitySet.hasEntity(entity_name) that returns true/false depending on if an entity with that name exists in this set.
###v1.2.1 [Dec 24, 2014]
- Entities added to a set are no longer added by reference - they are added by copy/value giving each set their own instance of that entity.
###v1.2 [Dec 23, 2014]
- Added basic functionality to track and display any attribute belonging to any object (that's part of their .attributes[]) in any html element.
- Minor code enhancements.
- EntitySet.getSet() is now EntitySet.getEntities() to avoid confusion with Game.getSet(set name) ----> EntitySet.getSet() will still work but will be removed completely in future versions.
- Added untracking of any attribute belonging to an object (second commit)
###v1.1 [Dec 22, 2014]
- Sets/Entities are now returned upon adding/modifying them.
- Entity Sets now have attributes as well
- Added AttributeSets that are simply normal javascript objects with some extended properties to help manage the attributes within
- Added a parent object called 'Common' which contains elements that every other object needs.
- Added an attributes[] list to Common, which is inherited by Game(), EntitySet(), Entity()
- Added functions to remove an EntitySet from Game().sets, as well as an Entity from EntitySet().getSet()
###v1.0 [Dec 21, 2014]
- Added Entity and EntitySets to manage different sets of different entities.