Skip to content

Commit 9185979

Browse files
committed
Bug fixes from February
1 parent 5cb88c1 commit 9185979

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99

1010
Polar.js is a quick, intuitive and easy 2D game engine developed in TypeScript for use on the web. It uses WebGL2 to deliver competitive performance and an entity component system to ensure scalability and ease of development.
11-
## Showcase
12-
https://youtu.be/ZVPHzbGP_gs
11+
1312
## Getting Started
1413
```js
1514
// Add some example code here
@@ -41,4 +40,4 @@ To make my life easier:
4140
- Include a brief explanation of why you changed it.
4241

4342
## Credits
44-
Created by Alex Brown, Harry Ickeringill and Jake Palandri.
43+
Created by Alex Brown, Harry Ickeringill and Jake Palandri.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"typedoc": "^0.15.0",
3434
"typescript": "^3.6.4",
3535
"webpack": "^4.41.2",
36-
"webpack-cli": "^3.3.10"
36+
"webpack-cli": "^3.3.12"
3737
},
3838
"dependencies": {
3939
"@types/gl-matrix": "^2.4.5",

src/Polar/Renderer/InstancedRenderer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class InstancedRenderer {
8686
*/
8787
public static submitTextured(textureAlias: string, transform: glm.mat4) {
8888
if (this.instanceCount < MAX_INSTANCES) {
89-
this.instanceData.set(Float32Concat(transform, this.textureAtlas.getBounds(textureAlias)),
89+
this.instanceData.set(Float32Concat(new Float32Array(transform), new Float32Array(this.textureAtlas.getBounds(textureAlias))),
9090
this.instanceCount * this.instanceBuffer.getLayout().getComponentCount());
9191
this.instanceCount++;
9292
}

src/Polar/Renderer/LightRenderer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export class LightRenderer {
160160
*/
161161
public static submitLight(color: glm.vec3, intensity: number, transform: glm.mat4) {
162162
if (this.lightCount < MAX_LIGHTS) {
163-
this.lightData.set(Float32Concat(transform, Float32Concat(color, new Float32Array([intensity]))),
163+
this.lightData.set(Float32Concat(new Float32Array(transform), Float32Concat(new Float32Array(color), new Float32Array([intensity]))),
164164
this.lightCount * this.instanceBuffer.getLayout().getComponentCount());
165165
this.lightCount++;
166166
}

src/Polar/Renderer/TextureAtlas.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ export class TextureAtlas {
7979
for (const rect of bin.rects) {
8080
const entry = rect as AtlasEntry;
8181
entry.bounds = glm.vec4.create();
82-
entry.bounds.set([entry.x / bin.width, entry.y / bin.height,
83-
entry.width / bin.width, entry.height / bin.height]);
82+
entry.bounds = glm.vec4.fromValues(entry.x / bin.width, entry.y / bin.height,
83+
entry.width / bin.width, entry.height / bin.height);
8484

8585
this.entries.set(entry.alias, entry);
8686
this.context.drawImage(entry.image, entry.x, entry.y);

tests/physics/ExamplePhysicsLayer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ExamplePhysicsLayer extends Polar.Layer {
1010
// Initialize singletons.
1111
this.manager.addSingleton(new Polar.CameraCP());
1212
this.manager.addSingleton(new Polar.CameraControllerCP(Polar.Surface.getWidth() / Polar.Surface.getHeight(), 1, true));
13-
this.manager.addSingleton(new Polar.PhysicsWorldCP({ gravity: [0, -3] }));
13+
this.manager.addSingleton(new Polar.PhysicsWorldCP({ gravity: [0, -9.8] }));
1414
this.manager.addSingleton(new Polar.PhysicsDebugInteractionCP(true));
1515
this.manager.addSingleton(new Polar.FPSDebugCP());
1616

0 commit comments

Comments
 (0)