@beanthealien/phantomjs
v2.1.2
Published
Phantom.js is a web API to simplify the webgame development proccess. Phantom.js is a 2D webgame engine with readable and simple scripting!
Readme
PhantomJS
Phantom.js is a web API to simplify the webgame development proccess.
Phantom.js is a 2D game development API with readable and simple scripting.
Phantom.js is a side project, most of my focus is directed to GhostScript, so sorry for lack of attention on this. <3
Download
Avalible with npm!
npm install @beanthealien/phantomjsPhantom 2D v1.0.2 LEGACY
1.0.1
- Added PlayableCharacter.unbindAll().
1.0.2
- Fixed some errors of legacy usage of Scene.width(), Scene.height(), replaced with Scene.width, Scene.height. Docs
Phantom 2D v1.1.0 BETA
v1.0.1
- Open beta now open!
- Ported most legacy content
v1.0.2
- New
Localclass.
v1.0.3
- Added
wait,random.
v1.0.4
- Updated handling to use
PhantomEventType/EventType,PhantomEventHandle[]/EventHandle[]for event stores. - Deprecated
AudioMIME,Soundnow uses regularHTMLAudioElement(noHTMLSourceElement). (Note: you can still clarify themimeproperty to use the deprecated version)
v1.0.5
- Adjusted
Phantom2dEntity.setPosto have 2 overloads,(Vector)and(number, number). - Adjusted
Soundto serve a constructor withSoundOptionsand a constructor withSoundOptionsDeprecated(can test for deprecated opts withSoundOptionsIsSOD). - Added
SceneOptions.canvas: ... | string. Retrieves element, throwsNoCanvasErrorif it does not get an element. - Added
Phantom2dOptions,Presetoverloads forPhantom2dEntity.fromcalls. - Added
ErrRootclass. - Enhanced
randomto add(),(number)and(number, number).
v1.0.6
- Expanded
Cooldownto construct with(),(number),(boolean)and(number, boolean). - Added
Cookiesclass. - Minor structure changes.
v1.0.7
- Added
objIs. - The start to
Configare here! FilePicker,DirPickerto handle picking files/dirs.- (Most) classes have a static
ismethod that runsobjIs<PARENT_CLASS_TYPE>. SceneConfignow hasresolution,master,musicandsfxproperties.ImgConfignow hasrootproperty.
v1.0.8
- Minor structure changes to pickers.
- Added
ItemBox. - Fixed
Callback, addedPredicate,CallbackBase. Fixed descriptions accordingly. - Implemented
Img.config.root. - Added
Img.rebuild(string)to rebuild thesrc.
v1.0.9
- Added
EventManager,SceneEventManager,PhantomEventManagerfor optimization. - Added
Scene.__listenOn(EventType, EventHandle)andScene.__listenOff(EventType, EventHandle).
v1.0.10
- Added
chance(number),chance(number, number). - Added
bin/.
v1.0.11
- Changed
Phantom2dEntityto justEntity. - Added
LocalandSessionobjects (derived fromStorageRoot). DeprecatedLocal(nowLocalDeprecated).
v1.0.12
- Added
WallObject. (+published)
v1.0.13
- Added
Entity.initState,Entity.restoreInitState().
v1.0.14
- Added
Scene.screenshot(string, string?, number?). - Added
Clipboard. - Added
Tag,TagList.
v1.0.15
- Added further tag support (in
ScenewithfindByTag,hasByTag). - Added
Scene.some(PredicateEntity). - Added
ItemBox.filter(Predicate<T>),ItemBox.find(FindPredicate<T>),ItemBox.some(Predicate<T>). - Added
Items.find(FindPredicateEntity),Items.some(PredicateEntity).
v1.0.16
- Added
Vector.rotBtwn(Vector, Vector). - Added
Scene.rotBtwn(Entity, Entity). - Added
Scene.rotToMouse(Entity). - Added
SavedState,Entity.saveState(),Entity.restoreState(SavedState). - Changed
Entity.restoreInitState(and the associatedinitState) to use aSavedStatewithrestoreState. - Added
shallow<T>().
v1.0.17
- Added
PointAtComp,PointAtMouseComp. - Scene no longer assigns default
style="width: ...; height: .... (don't ask why it set it to "0px" before, I don't know) - Fixed some translation issues, fixed some handler function references.
- Fixed an error that caused
Runtimeto not discard its proccess ID. - Fixed an error that caused incorrect mouse position calculations.
- Fixed an error that caused the wrong angle to be returned when comparing entity-to-mouse. (originally mouse-to-entity)
- Updated documentation regarding the usage of
Sound.
v1.0.18
- Added
Scene.config.osnd = boolean. Checks for off-screen position before drawing. - Fixed an oversight in
Characterthat caused: no gravity updates to occur, no strength to be assigned and the gravity speed to not be updated. - Fixed an oversight in
Custom. - Need to fix an error that causes
Characters to fall throughWallObjects.
v1.0.18.1
- Fixed issue #2.
v1.0.18.2
- Fixed an oversight to properly cancel out
gravspdwhen grounded. - Added
get/setpropertyalphatoScene. - Updated
initcommand.
v1.0.19
- Added
onValueSetevent trigger to configs. - Added
ErrorEventlistener for scene.
v1.0.20
- Fixed
Character.onGroundissues. - Added
FloorObject. - Added
SceneOptions.border. - Updated
Sceneconstructor to not assigncanvas.widthandcanvas.heightto 0 if they are not passed. - Added
Scene.style(CSSStyleDeclaration)to streamline adding styles. - Added
Scene.center(),Scene.clientCenter().
v1.0.21
- Added
PhantomDestroyedEvent. BulletObjectnow firesPhantomDestroyedEventupon being destroyed.
v1.0.22
- Fixed the usage of
objIsto properly accept a constructor.
v1.0.23
- Added
EnhancedPhysicsComp. - Added
PhantomCompOptionsMapto enforce correctCompOptionsinstead of serving the defaultCompOptions. - Added
EnhancedPhysicsComp.fricto dampen velocity output. - Added cooldowns for key presses.
v1.0.23.1
- Fixed some oversights in
PlayabaleCharacter.bindCDhandling.
v1.0.24
- Updated some handling for components.
v1.0.24.1
- Updated
SoundOptionsIsSODto useo: SoundOptionsinstead ofo: any. - Added
tolproperty toBulletObject. - Added
Scene.onScrn.
v1.0.25
- FIxed
PlayableCharacter.bindCDhandling. - Published latest.
v1.0.26
- Added
Scene.follow,Scene.unfollowfor camera following.
v1.0.27
- Enhanced
BulletObjectto have its speed be reduced over time. - TODO: have the scene's gravity direction be enacted upon objects with gravity.
- Fixed a typo in some error documentation.
v1.0.28
- Added
GravityComp(needs testing).
v1.0.29
- Added
ArcMoveOrbitComp,ArcMoveSlingCompfor orbit and slingshot arc movement.
v1.0.30
- Started adding UI support.
v1.1.0
- Includes major additions to add UI support.
- Added text property getters and setters for
Scene. - Added support for UI children.
- Fixed an issue where text wouldn't properly receive a color.
- Fixed button color changing.
- Fixed user interactions with button firing invalid effects.
- Added
Itvl,FixedItvl.
v1.1.0.1
- Added
disabledproperty toButtonUI. - Updated
Scene.onlistener attached inButtonUIto check fordisabled.
v1.1.1
- Fixed an error in
Itemsthat didn't spread the passed items. - Added
lerp.
v1.1.2
- Updated
Sceneto use the newer method of components and component management.
v1.2.0
- Updated
Entityto properly accept children. - Started adding
SceneFontinterface for internal font management.
v1.2.1
- Added
Scene.raymethod.
v1.2.2
- Added
SaveFilePicker. - Restructured file pickers to use
FilePickerBase.
v1.2.3
- Started adding more aircraft support after finding an internal lack of support in the heli example.
v1.3.0
- Added debug ray.
- Added misc rendering for
Scene. - Added
Renderableinterface. - Added
Scene.rectRotd. - Restructured some rendering to use
rectRotdinScene.
v1.4.0
- Added
Aircraft.
v1.4.0.1
- Fixed
DebugRayto properly render no matter if there was a hit.
v1.4.0.2
- Added support for non-primitive classes in
Config.
v1.4.1
- Added
Scene.frustum,Scene.triangle,Scene.cone. - TODO: add
Externalclass.
v1.4.1.1
- Added
OpeningMode,OpeningModeFinalized.
v1.4.2
- Add
Externalclass. (needs testing)
v1.4.3
- Started adding
Weapon,Gun, other weapons. (for fighting/gun games)
v1.4.3.1
- Fixed an error that caused rotation testing to not work properly.
- Continued work on
examples/tf. Possible content port from there to the main library.
v1.4.3.2
- Transitioned
PlayableCharacterinto usingKeyInputs.
v1.4.3.3
- Add
KeyInputs.binds,KeyInputs.unbinds. - Discover errors/improvements-to-be-made by working on
examples/tf.
v1.4.4
- Add
MultiRaycast. - Refactor some
Raycastclasses to useRaycastBase.
v1.4.5
- Add
ConeRaycast. - Add
DebugConeRay. - Add more options for size for scene font.
v1.4.6
- Add
Scene.post,Scene.postAdd,Vector.lerp.
v1.4.7
- Update
LerpDevicehandling. - Change
SceneandLevelto useItemBox.
v2.0.0
- Provides a whole host of changes for
LerpDeviceand children. - Change
Sceneto utilize anItemBoxofFunctions for post-update. - Change
Runtime.deltato be proper deltatime.
v2.0.1
- Implement z-index for
Entity. - Sort elements during pre-render by z-index.
- Change
FilePickerto overload{ mult: false } => stringand{ mult: true } => string[].
v2.1.0
- Dual Scene support.
v2.1.1
- Add
KeyedTextUI.
