-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
114 changed files
with
10,033 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
## Repo with misc stuff created by me | ||
|
||
- [Water Waves Effect](https://horpia.github.io/demo/water-waves-effect/) | ||
- [Smoke Effect](https://horpia.github.io/demo/smoke-effect/) | ||
- [Smoke Effect](https://horpia.github.io/demo/smoke-effect/) | ||
- [Game - Racer-796](https://horpia.github.io/demo/racer796/dist/) |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title></title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> | ||
<script src="main.js?3"></script> | ||
</head> | ||
<body ondragstart="return false" style="margin: 0; background-color: #3a3a3a"> | ||
<div id="cont"></div> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "racer796", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "webpack --config webpack.config.js", | ||
"watch": "webpack --watch", | ||
"start": "webpack serve" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"ts-loader": "^9.2.8", | ||
"typescript": "^4.6.3", | ||
"webpack": "^5.72.0", | ||
"webpack-cli": "^4.9.2", | ||
"webpack-dev-server": "^4.8.1" | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title></title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> | ||
<script src="main.js?3"></script> | ||
</head> | ||
<body ondragstart="return false" style="margin: 0; background-color: #3a3a3a"> | ||
<div id="cont"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface AssetsItem { | ||
loadAssets(): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {AssetsItem} from "game/assets-item"; | ||
|
||
export class AssetsLoader { | ||
private items: Set<AssetsItem> = new Set<AssetsItem>(); | ||
|
||
addItem(item: AssetsItem): void { | ||
this.items.add(item); | ||
} | ||
|
||
async load(): Promise<void> { | ||
await Promise.all(Array.from(this.items).map(item => item.loadAssets())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import {Renderable} from "game/renderable"; | ||
import {CANVAS_HEIGHT, CANVAS_WIDTH, SCREEN_HEIGHT, SCREEN_WIDTH} from "game/config"; | ||
import {UIElement} from "game/ui-element"; | ||
|
||
export class Canvas implements UIElement { | ||
private readonly displayCanvas: HTMLCanvasElement; | ||
private readonly bufferCanvas: HTMLCanvasElement; | ||
private readonly displayCtx: CanvasRenderingContext2D; | ||
private readonly bufferCtx: CanvasRenderingContext2D; | ||
|
||
constructor() { | ||
this.displayCanvas = document.createElement('canvas'); | ||
this.displayCanvas.width = CANVAS_WIDTH; | ||
this.displayCanvas.height = CANVAS_HEIGHT; | ||
|
||
this.displayCtx = this.displayCanvas.getContext('2d', {alpha: false}); | ||
this.displayCtx.imageSmoothingEnabled = false; | ||
// @ts-ignore | ||
this.displayCtx.mozImageSmoothingEnabled = false; | ||
// @ts-ignore | ||
this.displayCtx.webkitImageSmoothingEnabled = false; | ||
|
||
this.bufferCanvas = document.createElement('canvas'); | ||
this.bufferCanvas.width = SCREEN_WIDTH; | ||
this.bufferCanvas.height = SCREEN_HEIGHT; | ||
this.bufferCanvas.style.cssText = 'font-smooth: never; -webkit-font-smoothing : none;'; | ||
this.bufferCtx = this.bufferCanvas.getContext('2d', {alpha: false}); | ||
this.bufferCtx.imageSmoothingEnabled = false; | ||
// @ts-ignore | ||
this.bufferCtx.mozImageSmoothingEnabled = false; | ||
// @ts-ignore | ||
this.bufferCtx.webkitImageSmoothingEnabled = false; | ||
} | ||
|
||
build(): void { | ||
} | ||
|
||
getElement(): HTMLElement { | ||
return this.displayCanvas; | ||
} | ||
|
||
clear(): void { | ||
this.bufferCtx.clearRect(0, 0, this.bufferCanvas.width, this.bufferCanvas.height); | ||
} | ||
|
||
draw(item: Renderable): void { | ||
this.bufferCtx.save(); | ||
item.render(this.bufferCtx); | ||
this.bufferCtx.restore(); | ||
} | ||
|
||
finishFrame(): void { | ||
this.displayCtx.drawImage(this.bufferCanvas, 0, 0, this.displayCanvas.width, this.displayCanvas.height); | ||
} | ||
} |
Oops, something went wrong.