Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivomo committed Feb 28, 2024
1 parent 4bcd17d commit 509a7d6
Show file tree
Hide file tree
Showing 10 changed files with 1,223 additions and 0 deletions.
24 changes: 24 additions & 0 deletions app/rg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
13 changes: 13 additions & 0 deletions app/rg/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Game</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/main.js"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions app/rg/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import './style.css'

import * as PIXI from 'pixi.js';

const init = () => {
const app = new PIXI.Application({
background: '#1099bb',
resizeTo: window,
});

document.querySelector('#app').appendChild(app.view);

// Create a Graphics object, set a fill color, draw a rectangle
let obj = new PIXI.Graphics();
obj.beginFill(0xff0000);
obj.drawCircle(500, 500, 100);

// Add it to the stage to render
app.stage.addChild(obj);

app.ticker.add(() => {
obj.x += 0.3
})
}

init();


18 changes: 18 additions & 0 deletions app/rg/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "rg",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"vite": "^5.1.0"
},
"dependencies": {
"pixi.js": "^7.4.0",
"sass": "^1.70.0"
}
}
Loading

0 comments on commit 509a7d6

Please sign in to comment.