Skip to content

Commit

Permalink
Now working on animation, rendering and hitbox of the main characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
serbanghita committed Jun 4, 2024
1 parent 36d1186 commit 92467ea
Show file tree
Hide file tree
Showing 49 changed files with 1,801 additions and 14,871 deletions.
5,536 changes: 1,594 additions & 3,942 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions packages/assets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.idea
19 changes: 15 additions & 4 deletions packages/assets/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
{
"name": "@serbanghita-gamedev/assets",
"version": "1.0.0",
"description": "",
"description": "Asset related utils (JSON, Images, etc)",
"version": "0.0.1",
"author": "Serban Ghita <[email protected]> (https://ghita.org)",
"license": "MIT",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"main": "src/index.ts",
"scripts": {
"build": "echo \"Error: no build specified for glhf-assets yet.\"",
"test": "echo \"Error: no test specified for glhf-assets yet.\""
},
"author": "Serban Ghita <[email protected]> (https://ghita.org)",
"license": "MIT"
"devDependencies": {
"@eslint/js": "^9.4.0",
"@types/eslint__js": "^8.42.3",
"eslint": "^9.4.0",
"typescript": "^5.4.5",
"typescript-eslint": "^7.11.0"
}
}
6 changes: 3 additions & 3 deletions packages/assets/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function loadLocalImage(data: string) {
let img = new Image();
let test1 = data.match(/([a-z0-9-_]+).(png|gif|jpg)$/i);
let test2 = data.match(/^data\:image\//i);
const img = new Image();
const test1 = data.match(/([a-z0-9-_]+).(png|gif|jpg)$/i);
const test2 = data.match(/^data:image\//i);
if (!test1 && !test2) {
throw new Error(`Trying to an load an invalid image ${data}.`);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/component/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export {default as Direction, Directions} from './Direction';
export {default as Keyboard} from './Keyboard';
export {default as Position} from './Position';
export {default as Renderable} from './Renderable';
export {default as SpriteSheet} from './SpriteSheet';
export {default as SpriteSheet, ISpriteSheetAnimation, ISpriteSheetProperties, IAnimation, IAnimationFrame} from './SpriteSheet';
export {default as State} from './State';
3 changes: 2 additions & 1 deletion packages/demo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
src/*.js
src/*.js.map
src/*.js.map
src/assets/sprites/*.png
File renamed without changes.
Loading

0 comments on commit 92467ea

Please sign in to comment.