mirror of
https://github.com/Noratrieb/redox.git
synced 2026-01-14 16:25:04 +01:00
different charges
This commit is contained in:
parent
42ed986722
commit
5febb6c83c
2 changed files with 5 additions and 5 deletions
|
|
@ -10,7 +10,7 @@ let mouseProperties: MouseProperties = {charge: 0, strength: 1, pos: new Vector(
|
||||||
|
|
||||||
export function initParticles() {
|
export function initParticles() {
|
||||||
particles = [];
|
particles = [];
|
||||||
const chargeToMass = [1, 1, 100];
|
const chargeToMass = [1, 1, 1];
|
||||||
|
|
||||||
for (let i = 0; i < 200; i++) {
|
for (let i = 0; i < 200; i++) {
|
||||||
const charge = Math.random() < 0.3 ? 0 : Math.random() < 0.5 ? 1 : -1;
|
const charge = Math.random() < 0.3 ? 0 : Math.random() < 0.5 ? 1 : -1;
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,15 @@ export default abstract class UIComponent {
|
||||||
this._isHovered = false;
|
this._isHovered = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract draw(ctx: Ctx): void;
|
public abstract draw(ctx: Ctx): void;
|
||||||
|
|
||||||
abstract click(mousePos: Vector): void;
|
public abstract click(mousePos: Vector): void;
|
||||||
|
|
||||||
onHoverEnter(): void {
|
public onHoverEnter(): void {
|
||||||
this._isHovered = true;
|
this._isHovered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
onHoverLeave(): void {
|
public onHoverLeave(): void {
|
||||||
this._isHovered = false;
|
this._isHovered = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue