littlejsengine 1.9.9 → 1.9.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/littlejs.d.ts +27 -5
- package/dist/littlejs.esm.js +62 -36
- package/dist/littlejs.esm.min.js +1 -1
- package/dist/littlejs.js +56 -34
- package/dist/littlejs.min.js +1 -1
- package/dist/littlejs.release.js +39 -32
- package/examples/box2d/game.js +28 -9
- package/examples/box2d/gameObjects.js +485 -0
- package/examples/box2d/index.html +5 -4
- package/examples/box2d/scenes.js +28 -247
- package/examples/box2d/tiles.png +0 -0
- package/examples/breakout/index.html +3 -3
- package/examples/breakoutTutorial/index.html +2 -2
- package/examples/electron/index.html +2 -2
- package/examples/js13k/index.html +13 -13
- package/examples/module/index.html +1 -1
- package/examples/particles/index.html +1 -1
- package/examples/platformer/gameCharacter.js +1 -0
- package/examples/platformer/gameEffects.js +0 -2
- package/examples/platformer/gameObjects.js +1 -1
- package/examples/platformer/index.html +8 -8
- package/examples/puzzle/index.html +2 -2
- package/examples/starter/game.js +1 -1
- package/examples/starter/index.html +13 -13
- package/examples/stress/index.html +1 -1
- package/examples/typescript/index.html +1 -1
- package/package.json +1 -1
- package/plugins/box2d.js +114 -41
- package/src/engine.js +1 -1
- package/src/engineAudio.js +16 -16
- package/src/engineDebug.js +17 -2
- package/src/engineExport.js +5 -2
- package/src/engineInput.js +7 -3
- package/src/engineObject.js +15 -12
package/examples/box2d/scenes.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
/*
|
|
2
2
|
LittleJS Box2D Example - Secenes
|
|
3
3
|
- Each scene demonstrates a feature of Box2D
|
|
4
|
+
- Feel free to use tis code in your own projects
|
|
5
|
+
- 0 = Shapes: box, circle, poly, and edge
|
|
6
|
+
- 1 = Pyramid stack
|
|
7
|
+
- 2 = Dominoes chain reaction
|
|
8
|
+
- 3 = Car with controls
|
|
9
|
+
- 4 = Rope with box attached
|
|
10
|
+
- 5 = Raycasts in all directions
|
|
11
|
+
- 6 = Joints demo with every joint type
|
|
12
|
+
- 7 = Contacts begin and end callbacks
|
|
13
|
+
- 8 = Mobile object with multiple bodies
|
|
14
|
+
- 9 = Cloth object grid using rope joints
|
|
15
|
+
- 10 = Softbody object grid using weld joints
|
|
4
16
|
*/
|
|
5
17
|
|
|
6
18
|
'use strict';
|
|
@@ -15,8 +27,8 @@ function loadScene(_scene)
|
|
|
15
27
|
|
|
16
28
|
// destroy old scene
|
|
17
29
|
engineObjectsDestroy();
|
|
18
|
-
carWheelJoint = 0;
|
|
19
30
|
mouseJoint = 0;
|
|
31
|
+
car = 0;
|
|
20
32
|
|
|
21
33
|
// create walls
|
|
22
34
|
groundObject = spawnBox(vec2(0,-4), vec2(1e3,8), hsl(0,0,.2), box2dBodyTypeStatic);
|
|
@@ -54,7 +66,7 @@ function loadScene(_scene)
|
|
|
54
66
|
if (scene == 3)
|
|
55
67
|
{
|
|
56
68
|
sceneName = 'Car';
|
|
57
|
-
|
|
69
|
+
car = new CarObject(vec2(10,2));
|
|
58
70
|
spawnBox(vec2(20,0), vec2(10,2), randColor(), box2dBodyTypeStatic, false, -.2);
|
|
59
71
|
spawnPyramid(vec2(32,0), 6);
|
|
60
72
|
}
|
|
@@ -99,29 +111,11 @@ function loadScene(_scene)
|
|
|
99
111
|
l1.renderOrder = l2.renderOrder = -2;
|
|
100
112
|
}
|
|
101
113
|
{
|
|
102
|
-
// pulley object renders a rope to connected point
|
|
103
|
-
class PulleyObjects extends Box2dObject
|
|
104
|
-
{
|
|
105
|
-
constructor(pos, size, color, connectionPos)
|
|
106
|
-
{
|
|
107
|
-
super(pos, size, tile(3), 0, color);
|
|
108
|
-
this.addBox(size);
|
|
109
|
-
this.connectionPos = connectionPos;
|
|
110
|
-
}
|
|
111
|
-
render()
|
|
112
|
-
{
|
|
113
|
-
// draw rope
|
|
114
|
-
const topPos = this.localToWorld(vec2(0,this.size.y/2));
|
|
115
|
-
drawLine(topPos, this.connectionPos, .2, BLACK);
|
|
116
|
-
super.render();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
114
|
// pulley joint
|
|
121
115
|
const anchorA = vec2(14,15);
|
|
122
116
|
const anchorB = vec2(26,15);
|
|
123
|
-
const oA = new
|
|
124
|
-
const oB = new
|
|
117
|
+
const oA = new PulleyJointObjects(vec2(15,8), vec2(1,2), randColor(), anchorA);
|
|
118
|
+
const oB = new PulleyJointObjects(vec2(25,8), vec2(1,2), randColor(), anchorB);
|
|
125
119
|
const aA = spawnCircle(anchorA, 2, randColor(), box2dBodyTypeStatic);
|
|
126
120
|
const aB = spawnCircle(anchorB, 2, randColor(), box2dBodyTypeStatic);
|
|
127
121
|
const oaA = oA.localToWorld(vec2(0,oA.size.y/2));
|
|
@@ -156,31 +150,10 @@ function loadScene(_scene)
|
|
|
156
150
|
box2dCreateDistanceJoint(o1, o2);
|
|
157
151
|
}
|
|
158
152
|
{
|
|
159
|
-
// motor object renders a rope to connected point
|
|
160
|
-
class MotorObject extends Box2dObject
|
|
161
|
-
{
|
|
162
|
-
constructor(pos, size, color, otherObject)
|
|
163
|
-
{
|
|
164
|
-
super(pos, size, tile(4), 0, color);
|
|
165
|
-
this.addCircle(size.x);
|
|
166
|
-
this.connectionPos = pos;
|
|
167
|
-
const joint = box2dCreateMotorJoint(otherObject, this);
|
|
168
|
-
joint.SetMaxForce(500);
|
|
169
|
-
joint.SetMaxTorque(500);
|
|
170
|
-
}
|
|
171
|
-
render()
|
|
172
|
-
{
|
|
173
|
-
// draw rope
|
|
174
|
-
const width = 2/(1+this.pos.distance(this.connectionPos));
|
|
175
|
-
drawLine(this.pos, this.connectionPos, width, BLACK);
|
|
176
|
-
super.render();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
153
|
// motor joint
|
|
181
154
|
const o = new Box2dObject(vec2(10,8), vec2(4), tile(2), 0, randColor(), box2dBodyTypeStatic);
|
|
182
155
|
o.renderOrder = -2;
|
|
183
|
-
new
|
|
156
|
+
new MotorJointObject(vec2(10,8), vec2(2), randColor(), o);
|
|
184
157
|
}
|
|
185
158
|
{
|
|
186
159
|
// friction joint
|
|
@@ -194,26 +167,8 @@ function loadScene(_scene)
|
|
|
194
167
|
if (scene == 7)
|
|
195
168
|
{
|
|
196
169
|
sceneName = 'Contacts';
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
{
|
|
200
|
-
constructor(pos, size, color, contactColor, isSensor=false)
|
|
201
|
-
{
|
|
202
|
-
super(pos, size, 0, 0, color, box2dBodyTypeStatic);
|
|
203
|
-
if (isSensor)
|
|
204
|
-
{
|
|
205
|
-
this.addCircle(size.x);
|
|
206
|
-
this.setSensor(isSensor);
|
|
207
|
-
}
|
|
208
|
-
else
|
|
209
|
-
this.addBox(size);
|
|
210
|
-
this.contactColor = contactColor;
|
|
211
|
-
}
|
|
212
|
-
beginContact(other) { other.color = this.contactColor; }
|
|
213
|
-
endContact(other) { other.color = WHITE; }
|
|
214
|
-
}
|
|
215
|
-
new ContactTester(vec2(15,8), vec2(5), hsl(0,0,0,.3), RED, true);
|
|
216
|
-
new ContactTester(vec2(25,8), vec2(5), hsl(0,0,.1), GREEN);
|
|
170
|
+
new ContactTester(vec2(15,8), vec2(5), RED, RED);
|
|
171
|
+
new ContactTester(vec2(25,8), vec2(5), CYAN, CYAN, false, false);
|
|
217
172
|
for (let i=200;i--;)
|
|
218
173
|
spawnRandomObject(vec2(rand(1,39), rand(10,50)));
|
|
219
174
|
}
|
|
@@ -221,192 +176,18 @@ function loadScene(_scene)
|
|
|
221
176
|
{
|
|
222
177
|
sceneName = 'Mobile';
|
|
223
178
|
const pos = vec2(20, 16);
|
|
224
|
-
const mobile =
|
|
179
|
+
const mobile = new MobileObject(pos, 12, 2, 5);
|
|
225
180
|
box2dCreateRevoluteJoint(groundObject, mobile, pos);
|
|
226
181
|
}
|
|
227
|
-
|
|
228
|
-
// helper functions
|
|
229
|
-
function spawnRandomEdges()
|
|
230
|
-
{
|
|
231
|
-
// edge list along bottom
|
|
232
|
-
const edgePoints = [];
|
|
233
|
-
edgePoints.push(vec2(40,0));
|
|
234
|
-
for (let i=40, y=0; i--;)
|
|
235
|
-
edgePoints.push(vec2(i, y=clamp(y+rand(-2,2),0,5)));
|
|
236
|
-
edgePoints.push(vec2(0,0));
|
|
237
|
-
const o = new Box2dObject(vec2(), vec2(), 0, 0, BLACK, box2dBodyTypeStatic);
|
|
238
|
-
o.addEdgeList(edgePoints);
|
|
239
|
-
}
|
|
240
|
-
function spawnRope(startPos, count, angle=PI, color=WHITE, size=vec2(.3,1))
|
|
241
|
-
{
|
|
242
|
-
let lastObject = groundObject;
|
|
243
|
-
for (let i=0; i<count; ++i)
|
|
244
|
-
{
|
|
245
|
-
const pos = startPos.add(size.multiply(vec2(0,i+.5)).rotate(-angle));
|
|
246
|
-
const o = spawnBox(pos, size, color, box2dBodyTypeDynamic, false, angle);
|
|
247
|
-
o.setFilterData(2, 2);
|
|
248
|
-
const anchorPos = pos.add(vec2(0,-size.y/2).rotate(-angle));
|
|
249
|
-
box2dCreateRevoluteJoint(lastObject, o, anchorPos);
|
|
250
|
-
lastObject = o;
|
|
251
|
-
}
|
|
252
|
-
const endPos = lastObject.localToWorld(vec2(0,-size.y/2));
|
|
253
|
-
box2dCreateRopeJoint(groundObject, lastObject, startPos, endPos);
|
|
254
|
-
return lastObject;
|
|
255
|
-
}
|
|
256
|
-
function spawnPyramid(pos, count)
|
|
257
|
-
{
|
|
258
|
-
for (let i=count+1;i--;)
|
|
259
|
-
for (let j=i;j--;)
|
|
260
|
-
spawnBox(pos.add(vec2(j-i/2+.5,count-i+.5)), 1, randColor());
|
|
261
|
-
}
|
|
262
|
-
function spawnDominoes(pos, count, size=vec2(.5,2))
|
|
263
|
-
{
|
|
264
|
-
for (let i=count; i--;)
|
|
265
|
-
spawnBox(pos.add(vec2(i*size.y*.9,size.y/2)), size, randColor());
|
|
266
|
-
}
|
|
267
|
-
function spawnCar(pos)
|
|
268
|
-
{
|
|
269
|
-
// car object
|
|
270
|
-
const car = new Box2dObject(pos, vec2(), 0, 0, randColor());
|
|
271
|
-
const carPoints = [
|
|
272
|
-
vec2(-1.5,-.5),
|
|
273
|
-
vec2(1.5, -.5),
|
|
274
|
-
vec2(1.5, 0),
|
|
275
|
-
vec2(0, .9),
|
|
276
|
-
vec2(-1.15,.9),
|
|
277
|
-
vec2(-1.5, .2),
|
|
278
|
-
];
|
|
279
|
-
car.addPoly(carPoints);
|
|
280
|
-
|
|
281
|
-
// wheel settings
|
|
282
|
-
const frequencyHz = 4;
|
|
283
|
-
const dampingRatio = .7;
|
|
284
|
-
const wheelDensity = 1;
|
|
285
|
-
const wheelFriction = 2;
|
|
286
|
-
const wheelRestitution = 0;
|
|
287
|
-
const wheelSize = .8;
|
|
288
|
-
|
|
289
|
-
// back wheel
|
|
290
|
-
const wheel1Pos = pos.add(vec2(-1, -.65));
|
|
291
|
-
const wheel1 = new Box2dObject(wheel1Pos, vec2(wheelSize), tile(4));
|
|
292
|
-
wheel1.addCircle(wheelSize,vec2(),wheelDensity,wheelFriction,wheelRestitution);
|
|
293
|
-
const joint1 = box2dCreateWheelJoint(car,wheel1);
|
|
294
|
-
joint1.SetSpringDampingRatio(dampingRatio);
|
|
295
|
-
joint1.SetSpringFrequencyHz(frequencyHz);
|
|
296
|
-
joint1.SetMaxMotorTorque(50);
|
|
297
|
-
joint1.EnableMotor(true);
|
|
298
|
-
carWheelJoint = joint1;
|
|
299
|
-
|
|
300
|
-
// front wheel
|
|
301
|
-
const wheel2Pos = pos.add(vec2(1, -.6));
|
|
302
|
-
const wheel2 = new Box2dObject(wheel2Pos, vec2(wheelSize), tile(4));
|
|
303
|
-
wheel2.addCircle(wheelSize,vec2(),wheelDensity,wheelFriction,wheelRestitution);
|
|
304
|
-
const joint2 = box2dCreateWheelJoint(car,wheel2);
|
|
305
|
-
joint2.SetSpringDampingRatio(dampingRatio);
|
|
306
|
-
joint2.SetSpringFrequencyHz(frequencyHz);
|
|
307
|
-
}
|
|
308
|
-
function spawnMobile(anchor, w, h, depth)
|
|
309
|
-
{
|
|
310
|
-
// tall box
|
|
311
|
-
const pos = anchor.add(vec2(0,-h/2));
|
|
312
|
-
const o = spawnBox(pos, vec2(h/4, h), randColor(), box2dBodyTypeDynamic, false);
|
|
313
|
-
if (--depth)
|
|
314
|
-
{
|
|
315
|
-
// long box on bottom
|
|
316
|
-
o.addBox(vec2(w, h/4), vec2(0, -h/2));
|
|
317
|
-
|
|
318
|
-
// spawn smaller mobiles attached to each side
|
|
319
|
-
for(let i=2; i--;)
|
|
320
|
-
{
|
|
321
|
-
const a = anchor.add(vec2( w/2*(i?1:-1), -h));
|
|
322
|
-
const o2 = spawnMobile(a, w/2, h, depth);
|
|
323
|
-
box2dCreateRevoluteJoint(o, o2, a);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
return o;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
331
|
-
// Spawn object functions
|
|
332
|
-
|
|
333
|
-
function spawnBox(pos, size=1, color=WHITE, type=box2dBodyTypeDynamic, applyTexture=true, angle=0)
|
|
334
|
-
{
|
|
335
|
-
size = typeof size == 'number' ? vec2(size) : size; // square
|
|
336
|
-
const o = new Box2dObject(pos, size, applyTexture && tile(3), angle, color, type);
|
|
337
|
-
o.addBox(size);
|
|
338
|
-
return o;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
function spawnCircle(pos, diameter=1, color=WHITE, type=box2dBodyTypeDynamic, applyTexture=true, angle=0)
|
|
342
|
-
{
|
|
343
|
-
const size = vec2(diameter);
|
|
344
|
-
const o = new Box2dObject(pos, size, applyTexture && tile(2), angle, color, type);
|
|
345
|
-
o.addCircle(diameter);
|
|
346
|
-
return o;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
function spawnRandomPoly(pos, diameter=1, color=WHITE, type=box2dBodyTypeDynamic, angle=0)
|
|
350
|
-
{
|
|
351
|
-
const o = new Box2dObject(pos, vec2(), 0, angle, color, type);
|
|
352
|
-
o.addRandomPoly(diameter);
|
|
353
|
-
return o;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
function spawnRandomObject(pos, scale=1, type=box2dBodyTypeDynamic, angle=0)
|
|
357
|
-
{
|
|
358
|
-
if (randInt(2))
|
|
182
|
+
if (scene == 9)
|
|
359
183
|
{
|
|
360
|
-
|
|
361
|
-
|
|
184
|
+
sceneName = 'Cloth';
|
|
185
|
+
new ClothObject(vec2(20, 9), vec2(15), vec2(24), randColor());
|
|
362
186
|
}
|
|
363
|
-
|
|
364
|
-
{
|
|
365
|
-
const diameter = scale*rand(.5,1);
|
|
366
|
-
return spawnCircle(pos, diameter, randColor(), type, true, angle);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
371
|
-
// Effects
|
|
372
|
-
|
|
373
|
-
const sound_click = new Sound([,.1]);
|
|
374
|
-
const sound_explosion = new Sound([,.2,72,.01,.01,.2,4,,,,,,,1,,.5,.1,.5,.02]);
|
|
375
|
-
|
|
376
|
-
function explosion(pos, radius=3, strength=300)
|
|
377
|
-
{
|
|
378
|
-
sound_explosion.play(pos);
|
|
379
|
-
const objects = box2dCircleCastAll(pos, (radius*2));
|
|
380
|
-
const newColor = randColor();
|
|
381
|
-
for (const o of objects)
|
|
187
|
+
if (scene == 10)
|
|
382
188
|
{
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
o.color = newColor;
|
|
189
|
+
sceneName = 'Softbodies';
|
|
190
|
+
for(let i=3;i--;)
|
|
191
|
+
new SoftBodyObject(vec2(20, 3+i*7), vec2(6-i), vec2(9-i), randColor());
|
|
387
192
|
}
|
|
388
|
-
|
|
389
|
-
// smoke
|
|
390
|
-
new ParticleEmitter(
|
|
391
|
-
pos, 0, // pos, angle
|
|
392
|
-
radius/2, .2, 50*radius, PI,// emitSize, emitTime, emitRate, emiteCone
|
|
393
|
-
tile(1), // tileInfo
|
|
394
|
-
hsl(0,0,0), hsl(0,0,0), // colorStartA, colorStartB
|
|
395
|
-
hsl(0,0,0,0), hsl(0,0,0,0), // colorEndA, colorEndB
|
|
396
|
-
1, 1, 2, .1, .1, // time, sizeStart, sizeEnd, speed, angleSpeed
|
|
397
|
-
.9, 1, -.5, PI, .1, // damp, angleDamp, gravity, particleCone, fade
|
|
398
|
-
1, 0, 0, 0, 1e8 // randomness, collide, additive, colorLinear, renderOrder
|
|
399
|
-
);
|
|
400
|
-
|
|
401
|
-
// fire
|
|
402
|
-
new ParticleEmitter(
|
|
403
|
-
pos, 0, // pos, angle
|
|
404
|
-
radius, .1, 100*radius, PI, // emitSize, emitTime, emitRate, emiteCone
|
|
405
|
-
tile(1), // tileInfo
|
|
406
|
-
hsl(0,1,.5), hsl(.15,1,.5), // colorStartA, colorStartB
|
|
407
|
-
hsl(0,1,.5,0), hsl(.1, 1,.5,0), // colorEndA, colorEndB
|
|
408
|
-
.7, 1, .5, .1, .1, // time, sizeStart, sizeEnd, speed, angleSpeed
|
|
409
|
-
.9, 1, 0, PI, .05, // damp, angleDamp, gravity, particleCone, fade
|
|
410
|
-
1, 0, 1, 0, 1e9 // randomness, collide, additive, colorLinear, renderOrder
|
|
411
|
-
);
|
|
412
|
-
}
|
|
193
|
+
}
|
package/examples/box2d/tiles.png
CHANGED
|
Binary file
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel=icon type=image/png href=../favicon.png>
|
|
6
6
|
</head><body>
|
|
7
7
|
|
|
8
|
-
<script src=../../dist/littlejs.js?
|
|
8
|
+
<script src=../../dist/littlejs.js?198></script>
|
|
9
9
|
<script src=../../plugins/postProcess.js></script>
|
|
10
|
-
<script src=gameObjects.js?
|
|
11
|
-
<script src=game.js?
|
|
10
|
+
<script src=gameObjects.js?198></script>
|
|
11
|
+
<script src=game.js?198></script>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<head><title>LittleJS JS13K Project</title></head><body>
|
|
2
2
|
|
|
3
3
|
<!-- LittleJS Engine -->
|
|
4
|
-
<script src=../../src/engineDebug.js?
|
|
5
|
-
<script src=../../src/engineUtilities.js?
|
|
6
|
-
<script src=../../src/engineSettings.js?
|
|
7
|
-
<script src=../../src/engineObject.js?
|
|
8
|
-
<script src=../../src/engineDraw.js?
|
|
9
|
-
<script src=../../src/engineInput.js?
|
|
10
|
-
<script src=../../src/engineAudio.js?
|
|
11
|
-
<script src=../../src/engineTileLayer.js?
|
|
12
|
-
<script src=../../src/engineParticles.js?
|
|
13
|
-
<script src=../../src/engineMedals.js?
|
|
14
|
-
<script src=../../src/engineWebGL.js?
|
|
15
|
-
<script src=../../src/engine.js?
|
|
4
|
+
<script src=../../src/engineDebug.js?198></script>
|
|
5
|
+
<script src=../../src/engineUtilities.js?198></script>
|
|
6
|
+
<script src=../../src/engineSettings.js?198></script>
|
|
7
|
+
<script src=../../src/engineObject.js?198></script>
|
|
8
|
+
<script src=../../src/engineDraw.js?198></script>
|
|
9
|
+
<script src=../../src/engineInput.js?198></script>
|
|
10
|
+
<script src=../../src/engineAudio.js?198></script>
|
|
11
|
+
<script src=../../src/engineTileLayer.js?198></script>
|
|
12
|
+
<script src=../../src/engineParticles.js?198></script>
|
|
13
|
+
<script src=../../src/engineMedals.js?198></script>
|
|
14
|
+
<script src=../../src/engineWebGL.js?198></script>
|
|
15
|
+
<script src=../../src/engine.js?198></script>
|
|
16
16
|
|
|
17
17
|
<!-- Add your game scripts here -->
|
|
18
|
-
<script src=game.js?
|
|
18
|
+
<script src=game.js?198></script>
|
|
@@ -92,8 +92,6 @@ function explosion(pos, radius=3)
|
|
|
92
92
|
const p = percent(d, 2*radius, radius);
|
|
93
93
|
const force = o.pos.subtract(pos).normalize(p*radius*.2);
|
|
94
94
|
o.applyForce(force);
|
|
95
|
-
if (o.isDead && o.isDead())
|
|
96
|
-
o.angleVelocity += randSign()*rand(p*radius/4,.3);
|
|
97
95
|
});
|
|
98
96
|
|
|
99
97
|
// smoke
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
<link rel=icon type=image/png href=../favicon.png>
|
|
7
7
|
</head><body>
|
|
8
8
|
|
|
9
|
-
<script src=../../dist/littlejs.js?
|
|
10
|
-
<script src=gameObjects.js?
|
|
11
|
-
<script src=gameCharacter.js?
|
|
12
|
-
<script src=gamePlayer.js?
|
|
13
|
-
<script src=gameEffects.js?
|
|
14
|
-
<script src=gameLevel.js?
|
|
15
|
-
<script src=gameLevelData.js?
|
|
16
|
-
<script src=game.js?
|
|
9
|
+
<script src=../../dist/littlejs.js?198></script>
|
|
10
|
+
<script src=gameObjects.js?198></script>
|
|
11
|
+
<script src=gameCharacter.js?198></script>
|
|
12
|
+
<script src=gamePlayer.js?198></script>
|
|
13
|
+
<script src=gameEffects.js?198></script>
|
|
14
|
+
<script src=gameLevel.js?198></script>
|
|
15
|
+
<script src=gameLevelData.js?198></script>
|
|
16
|
+
<script src=game.js?198></script>
|
package/examples/starter/game.js
CHANGED
|
@@ -63,7 +63,7 @@ function gameInit()
|
|
|
63
63
|
// create particle emitter
|
|
64
64
|
particleEmitter = new ParticleEmitter(
|
|
65
65
|
vec2(16,9), 0, // emitPos, emitAngle
|
|
66
|
-
|
|
66
|
+
0, 0, 500, PI, // emitSize, emitTime, emitRate, emiteCone
|
|
67
67
|
tile(0, 16), // tileIndex, tileSize
|
|
68
68
|
hsl(1,1,1), hsl(0,0,0), // colorStartA, colorStartB
|
|
69
69
|
hsl(0,0,0,0), hsl(0,0,0,0), // colorEndA, colorEndB
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
</head><body>
|
|
7
7
|
|
|
8
8
|
<!-- LittleJS Engine -->
|
|
9
|
-
<script src=../../src/engineDebug.js?
|
|
10
|
-
<script src=../../src/engineUtilities.js?
|
|
11
|
-
<script src=../../src/engineSettings.js?
|
|
12
|
-
<script src=../../src/engineObject.js?
|
|
13
|
-
<script src=../../src/engineDraw.js?
|
|
14
|
-
<script src=../../src/engineInput.js?
|
|
15
|
-
<script src=../../src/engineAudio.js?
|
|
16
|
-
<script src=../../src/engineTileLayer.js?
|
|
17
|
-
<script src=../../src/engineParticles.js?
|
|
18
|
-
<script src=../../src/engineMedals.js?
|
|
19
|
-
<script src=../../src/engineWebGL.js?
|
|
20
|
-
<script src=../../src/engine.js?
|
|
9
|
+
<script src=../../src/engineDebug.js?198></script>
|
|
10
|
+
<script src=../../src/engineUtilities.js?198></script>
|
|
11
|
+
<script src=../../src/engineSettings.js?198></script>
|
|
12
|
+
<script src=../../src/engineObject.js?198></script>
|
|
13
|
+
<script src=../../src/engineDraw.js?198></script>
|
|
14
|
+
<script src=../../src/engineInput.js?198></script>
|
|
15
|
+
<script src=../../src/engineAudio.js?198></script>
|
|
16
|
+
<script src=../../src/engineTileLayer.js?198></script>
|
|
17
|
+
<script src=../../src/engineParticles.js?198></script>
|
|
18
|
+
<script src=../../src/engineMedals.js?198></script>
|
|
19
|
+
<script src=../../src/engineWebGL.js?198></script>
|
|
20
|
+
<script src=../../src/engine.js?198></script>
|
|
21
21
|
|
|
22
22
|
<!-- Add your game scripts here -->
|
|
23
|
-
<script src=game.js?
|
|
23
|
+
<script src=game.js?198></script>
|