Commit Graph

102 Commits

Author SHA1 Message Date
Arthur Pacaud e2f8f70d54 Improve JSDoc in gd.js (#1459) 2020-02-23 20:34:37 +00:00
Arthur Pacaud 746b2f5480 Add more JSDoc/typing to gdjs.RuntimeObject and Hashtable (#1376) 2020-02-10 20:24:11 +00:00
Arthur Pacaud 054e48227c Make object and behavior registering more explicit (#1379) 2020-01-17 22:49:24 +00:00
Florian Rival 6655a949ec Fix GDJS doc generation (incompatible TypeScript/JSDoc notations) 2020-01-12 23:33:39 +00:00
Arthur Pacaud 99312c71e0 Improve overall type annotations (#1361)
* Add type annotation for ObjectData and related types.
* Add missing type annotations.
* Add // @ts-check to some files.
2020-01-12 20:14:00 +00:00
Florian Rival 977dc27bd0 Add update for effects + colors and resources for effect parameters 2019-12-21 12:04:08 +01:00
Florian Rival 23987f63c7 Change sprites flipping to use the center point as center for flipping
As flipping can be considered as a way to "rotate" things, it makes sense to have it used as a center for flipping too.i
This is useful for objects that are moving and can be flipped according to if they are going left or right: they can now
be rotated and flipped "properly" (properly means that the center will stay at the same position when flipped/rotated)

This means that the center point won't move when the sprite is rotated or flipped.
The origin is still used as the point not moving in case of scaling. (this make sense because scaling is about the size, and origin about positioning)
This remove some calculations in the renderers, but add others in getDrawableX/Y and getCenterX/Y in case of flipping.
2019-10-26 11:04:23 +01:00
Florian Rival aa7a4a4ff3 Rename onOwnerRemovedFromScene to onDestroy and fix onCreated/onDestroy calls
* Rename onOwnerRemovedFromScene to onDestroy (because it can be now called when a scene is destroyed)
* Fix it being not called when a scene is destroyed (so behavior don't get a chance to clean up what they have created)
* Fix onCreated being called before the object is fully initialized (for custom behaviors or behaviors relying on an object type)
2019-07-28 17:43:50 +01:00
Florian Rival 3e822e4ef0 Remove useless minus sign 2019-03-11 20:34:08 +00:00
Franco Maciel 2338b5bfd6 Use AABB to check if cursor is on object (#852) 2019-01-06 20:23:19 +00:00
Florian Rival 0f24410a2e Fix platform engine 1-pixel offset bug
* "Bug" is fixed by ignoring edges when doing collision tests for
the platform engine.
* Also add an option to round coordinates and ensure pixel-perfect
alignement of characters on platforms (on by default)
* Also add an optional parameter to ignore edges when
doing a collision test (or when separating objects)
2018-12-26 23:22:10 +01:00
Florian Rival 137ffc2b84 Optimize and rename clearing to multiplier in gdjs.Force 2018-11-28 21:41:11 +00:00
Florian Rival 7d165660a5 Fix rendering of ShapePainterRuntimeObject with absolute coordinates when far from camera
Fix #750
2018-11-21 00:31:37 +00:00
Florian Rival b84bb8630a Improve accuracy/performance of various computations and add benchmarks
Add tests for gdjs.Force
Add tests for gdjs.Layer
2018-10-28 06:41:09 -07:00
Florian Rival fb849be246 Fix AABB computation for rotate objects
AABB was not properly computed for rotated objects or objects
with a non default center/origin. This could create issues while checking
collisions and for behaviors/logic relying on spatial hashing (platformer,
pathfinding).

* Add benchmark to compare the speed of the implementation for non rotated object
(simple/faster) and for rotated objects (always exact but 12-15% slower).
* Add a method to render AABB of objects to ease debugging.
* Also add a test game.
* Add tests for AABB
* Add tests for getHitboxes for gdjs.SpriteRuntimeObject
2018-10-28 06:41:09 -07:00
Lizard-13 0c31e5ad44 Add object timers for GDJS (#604) 2018-08-29 23:29:20 +01:00
Lizard-13 d449a478f5 Fix behavior activated condition (#597) 2018-08-27 21:45:12 +01:00
Florian Rival 011932ba27 Improve some documentation/typing for GDJS 2018-08-17 23:42:16 +02:00
Florian Rival 525b99697b Improve some documentation/typing for gdjs.RuntimeObject 2018-08-17 21:07:47 +02:00
Florian Rival f182ed0704 Enhance/fix types in documentation of GDJS 2018-08-17 18:34:22 +02:00
Florian Rival 98f97f7b17 Add Monaco editor for JavaScript code events, with autocompletion support 2018-08-17 18:03:06 +02:00
Florian Rival 1c24e4f14d Fix RuntimeObject::PutAroundAPosition and gdjs.RuntimeObject.prototype.putAround
Positioning was not made using center of object which was making it inconsistent
with other related actions/expressions (like the expression to get distance).
2018-07-25 22:06:34 +01:00
Florian Rival df1fff36e4 Update GDJS documentation to add a index page and generate it from GenerateAllDocs script 2018-07-04 23:24:37 +01:00
Florian Rival 3be5d85733 Update GDJS docs to use JSDoc 2018-07-04 22:26:02 +01:00
Lizard-13 02ddea17ea Add raycast-to-position condition (#526) 2018-06-18 23:50:03 +01:00
Lizard-13 f5fa82c95e Fix distance check (#487) 2018-04-30 10:42:39 +01:00
Lizard-13 eb96ee8497 Fix @static hint 2018-02-17 17:56:07 -03:00
Lizard-13 458444ee7b Implement collinear case 2018-02-17 16:02:13 -03:00
Lizard-13 c8eb13f18f Minor fixes
Removed circle code, unused includes and debug lines.
Improved extension strings.
Added reference link.
Updated "Laser and zombies.gdg" example
2018-02-17 16:01:11 -03:00
Lizard-13 6bbfa1d4a1 Implement C++ version
And little fixes on the JS version
2018-02-17 16:00:32 -03:00
Lizard-13 3c3dc6ef6e Implement raycast JS version and test game 2018-02-17 16:00:18 -03:00
Lizard-13 5c101dbcda Engine condition set up
Neither tested nor compiled yet
2018-02-17 15:56:50 -03:00
Lizard-13 495900c083 Add point inside object condition (#418)
* Add point inside object condition

* Update names and comments
2017-12-04 09:25:56 +01:00
Lizard-13 6223fbb792 Add JSON conversion for all variable types and clear structure action (#391) 2017-09-30 19:18:56 +02:00
Bouh 0b28b0d15a Fix documentation for hasVariable() (#330) 2016-12-25 14:54:50 +01:00
Florian Rival 78ec0fd201 Optimize code generation for object variables actions with mutators functions 2016-12-24 17:00:20 +01:00
Bouh 9f81038f1d Fix description of setVariableString in doc (#326) 2016-12-19 19:06:19 +01:00
Florian Rival 40fcb668c4 Merge pull request #313 from 4ian/feature/layer-timescale
Time scale for layers and various fixes/improvements
2016-12-17 16:31:17 +01:00
Victor Levasseur 1ed005a472 Fix HTML5 game crash with non renderable objects 2016-12-10 12:19:25 +01:00
Florian Rival 42022290b8 Refactor gdjs.RuntimeObject and behaviors to allow per-layer timescale 2016-12-01 22:18:08 +01:00
Florian Rival 422132d8c7 Avoid allocations in gdjs.RuntimeObject.getRendererObject and gdjs.evtTools.object.pickObjectsIf 2016-08-15 19:54:01 +02:00
Florian Rival 682efcbfdc Avoid allocation in gdjs.PlatformerObjectRuntimeBehavior and add TODO where allocations should be removed 2016-08-14 18:59:42 +02:00
Florian Rival b3b39ab468 Remove gdjs.iterateOverArray and replace its usage by raw loops 2016-08-07 22:26:41 +02:00
Wend1go 2d3cdcdde8 Retrieve number of subitems from variable/structure (native/js)
- global variables (expression)
- scene variables  (expression)
- object variables (expression)
2016-07-22 09:07:49 +02:00
Florian Rival c7cd582152 Avoid creating objects when calling Hashtable.values() and by using gdjs.staticArray 2016-04-28 23:16:38 +02:00
Florian Rival ab2a347f97 Avoid creating a new Hashtable each tick in PlatformerObjectRuntimeBehavior and avoid creating temporary objects/arrays 2016-04-27 00:31:36 +02:00
Florian Rival 8d92dd818e Remove calls to Hashtable.keys(), useless function/object creations 2016-04-26 22:55:15 +02:00
Florian Rival 8e8b49f27d Fix gdjs.RuntimeObject.setLayer 2016-02-27 16:52:49 +01:00
Florian Rival 507c23f401 Move Sprite objects rendering to gdjs.SpriteRuntimeObjectPixiRenderer 2016-02-22 22:07:07 +01:00
Florian Rival 8a0d0d332d Rename gdjs.LayerPixiRenderer PIXI related methods 2016-02-21 17:16:13 +01:00