Skip to content

Commit

Permalink
Added new demo #new #demo
Browse files Browse the repository at this point in the history
  • Loading branch information
waynemwashuma committed Oct 21, 2023
1 parent a634f47 commit fa34e27
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
15 changes: 8 additions & 7 deletions demos/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { box } from "./box.js"
import { particle } from "./particle.js"
import { circle } from "./circle.js"
import { circlestacking } from "./circlestack.js"
import { triangle } from "./triangle.js"
import {
Manager,
Renderer2D,
Expand Down Expand Up @@ -105,16 +106,16 @@ export const demos = {
this.examples[n] = f
}
}
demos.register("box",box)
demos.register("stack",stacking)
demos.register("circle",circle)
demos.register("circlestacking",circlestacking)
demos.register("triangle",triangle)
demos.register("pyramid",pyramid)
demos.register("random",random)
demos.register("constraints",constraint)
demos.register("bridge",bridge)
demos.register("car",car)
demos.register("pyramid",pyramid)
demos.register("stack",stacking)
demos.register("constraints",constraint)
demos.register("pathfollower",pathfollower)
demos.register("box",box)
demos.register("random",random)
demos.register("materials",materials)
demos.register("particle",particle)
demos.register("circlestacking",circlestacking)
demos.register("circle",circle)
16 changes: 16 additions & 0 deletions demos/triangle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {
Entity,
Trigon,
BodySprite
} from "/src/index.js"
export function triangle(manager) {
let world = manager.getSystem("world")

let box = Entity.Default(200,100)
let body = new Trigon(50,50 * Math.sin(30),60)

box.attach("body",body)
.attach("sprite",new BodySprite())
manager.add(box)
world.gravity = 980
}

1 comment on commit fa34e27

@vercel
Copy link

@vercel vercel bot commented on fa34e27 Oct 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.