Organize imports and work on integrating lighting

This commit is contained in:
schmelczerandras 2020-07-24 23:00:26 +02:00
parent 0cd383794c
commit affb1b4f4f
16 changed files with 170 additions and 155 deletions

View file

@ -1,8 +1,8 @@
import { Typed } from '../transport/serializable';
import { IdentityManager } from '../identity/identity-manager';
import { vec2 } from 'gl-matrix';
import { Command } from '../commands/command';
import { CommandReceiver } from '../commands/command-receiver';
import { vec2 } from 'gl-matrix';
import { IdentityManager } from '../identity/identity-manager';
import { Typed } from '../transport/serializable';
export abstract class GameObject extends Typed implements CommandReceiver {
public readonly id = IdentityManager.generateId();

View file

@ -1,7 +1,7 @@
import { GameObject } from './game-object';
import { Id } from '../identity/identity';
import { Command } from '../commands/command';
import { CommandReceiver } from '../commands/command-receiver';
import { Id } from '../identity/identity';
import { GameObject } from './game-object';
export class ObjectContainer implements CommandReceiver {
private objects: Map<Id, GameObject> = new Map();

View file

@ -1,12 +1,12 @@
import { vec2 } from 'gl-matrix';
import { KeyDownCommand } from '../../commands/types/key-down';
import { KeyUpCommand } from '../../commands/types/key-up';
import { MoveToCommand } from '../../commands/types/move-to';
import { StepCommand } from '../../commands/types/step';
import { SwipeCommand } from '../../commands/types/swipe';
import { GameObject } from '../game-object';
import { ObjectContainer } from '../object-container';
import { Camera } from './camera';
import { MoveToCommand } from '../../commands/types/move-to';
import { StepCommand } from '../../commands/types/step';
import { KeyDownCommand } from '../../commands/types/key-down';
import { KeyUpCommand } from '../../commands/types/key-up';
import { SwipeCommand } from '../../commands/types/swipe';
import { vec2 } from 'gl-matrix';
export class Character extends GameObject {
private keysDown: Set<string> = new Set();

View file

@ -1,6 +1,6 @@
import { GameObject } from '../game-object';
import { DrawCommand } from '../../commands/types/draw';
import { vec2 } from 'gl-matrix';
import { DrawCommand } from '../../commands/types/draw';
import { GameObject } from '../game-object';
export interface Line {
start: vec2;
@ -17,13 +17,13 @@ export class Dungeon extends GameObject {
this.addCommandExecutor(DrawCommand, this.draw.bind(this));
let previousRadius = 0;
let previousRadius = 350;
let previousEnd = vec2.create();
for (let i = 0; i < 500000; i += 500) {
const height = previousEnd.y + (Math.random() - 0.5) * 2000;
const currentEnd = vec2.fromValues(i, height);
const currentToRadius = Math.random() * 10 + 300;
const currentToRadius = Math.random() * 300 + 150;
this.lines.push({
start: previousEnd,