initial commit

This commit is contained in:
2025-10-17 12:28:08 -07:00
commit 2b64ace453
26 changed files with 5493 additions and 0 deletions

50
client/src/main.ts Normal file
View File

@ -0,0 +1,50 @@
import { Application, Assets, Sprite } from "pixi.js";
import { Hand } from "./hand";
(async () => {
// Create a new application
const app = new Application();
// Initialize the application
await app.init({ background: "#1099bb", resizeTo: window });
// Append the application canvas to the document body
document.getElementById("pixi-container")!.appendChild(app.canvas);
try {
// Create the SpriteSheet from data and image
const cards = await Assets.load("/public/assets/cards.json");
console.log(cards);
// Create a bunny Sprite
const bunny = new Sprite(cards.textures["fourOfHearts"]);
console.log(bunny);
// Center the sprite's anchor point
bunny.anchor.set(0.5);
// Move the sprite to the center of the screen
bunny.position.set(app.screen.width / 2, app.screen.height / 2);
bunny.height /= 1.5;
bunny.width /= 1.5;
// Add the bunny to the stage
// app.stage.addChild(bunny);
const hand = new Hand(["fourOfDiamonds"]);
app.stage.addChild(hand.cards);
// Listen for animate update
// app.ticker.add((time) => {
// // Just for fun, let's rotate mr rabbit a little.
// // * Delta is 1 if running at 100% performance *
// // * Creates frame-independent transformation *
// bunny.rotation += 0.1 * time.deltaTime;
// });
} catch (err) {
console.log(err);
}
})();