This file contains hidden or 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
import pygame | |
import sys | |
# === CONFIGURABLE SETTINGS === | |
WINDOW_WIDTH = 512 | |
WINDOW_HEIGHT = 240 | |
UPSCALED_WIDTH = 1920 | |
UPSCALED_HEIGHT = 1080 | |
FONT_SIZE = 10 | |
TEXT_SCALE = 4 |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>3D Room with Controls</title> | |
<style> | |
html, body { | |
margin: 0; | |
overflow: hidden; | |
height: 100%; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>3D Room FPS Style</title> | |
<style> | |
body { margin: 0; overflow: hidden; } | |
canvas { display: block; background: #000; } | |
</style> | |
</head> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>3D Room FPS Style</title> | |
<style> | |
body { margin: 0; overflow: hidden; } | |
canvas { display: block; background: #000; } | |
</style> | |
</head> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>3D Room FPS Style</title> | |
<style> | |
body { margin: 0; overflow: hidden; } | |
canvas { display: block; background: #000; } | |
</style> | |
</head> |
This file contains hidden or 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
<canvas id="canvas" width="800" height="600"></canvas> | |
<script> | |
// ========== Vector Class ========== | |
class Vec3 { | |
constructor(x=0, y=0, z=0) { this.x=x; this.y=y; this.z=z; } | |
add(v) { return new Vec3(this.x+v.x, this.y+v.y, this.z+v.z); } | |
sub(v) { return new Vec3(this.x-v.x, this.y-v.y, this.z-v.z); } | |
rotateY(a) { | |
const cos = Math.cos(a), sin = Math.sin(a); | |
return new Vec3(this.x * cos - this.z * sin, this.y, this.x * sin + this.z * cos); |
This file contains hidden or 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
<canvas id="canvas" width="800" height="600"></canvas> | |
<script> | |
// Basic 3D Vector class | |
class Vector3 { | |
constructor(x = 0, y = 0, z = 0) { | |
this.x = x; this.y = y; this.z = z; | |
} | |
add(v) { return new Vector3(this.x + v.x, this.y + v.y, this.z + v.z); } | |
subtract(v) { return new Vector3(this.x - v.x, this.y - v.y, this.z - v.z); } |
This file contains hidden or 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
<canvas id="canvas" width="800" height="600"></canvas> | |
<script> | |
// --- Vector3 Class --- | |
class Vector3 { | |
constructor(x = 0, y = 0, z = 0) { | |
this.x = x; this.y = y; this.z = z; | |
} | |
add(v) { | |
return new Vector3(this.x + v.x, this.y + v.y, this.z + v.z); |
This file contains hidden or 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
<canvas id="canvas" width="600" height="600"></canvas> | |
<script> | |
// ----- 1. 3D Vector System ----- | |
class Vector3 { | |
constructor(x = 0, y = 0, z = 0) { | |
this.x = x; this.y = y; this.z = z; | |
} | |
add(v) { | |
return new Vector3(this.x + v.x, this.y + v.y, this.z + v.z); |
This file contains hidden or 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
class RandomStringGenerator { | |
constructor(seed = Date.now()) { | |
this.seed = seed; | |
} | |
// Linear Congruential Generator (LCG) for pseudo-random values | |
_random() { | |
// Parameters from Numerical Recipes | |
this.seed = (1664525 * this.seed + 1013904223) % 4294967296; | |
return this.seed / 4294967296; |
NewerOlder