Skip to content

Commit

Permalink
修复:图形节点bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightre committed Feb 13, 2024
1 parent 3d975a4 commit 6b0c8ed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions demo/pong/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
Container,
GraphicalType,
Rect,
Collision
Collision,
Graphical
} from "https://unpkg.com/sparkle-engine/dist/sparkle.js"
import Graphical from "../../src/nodes/graphical"

const engine = new SparkleEngine({
// 指定游戏画布元素
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sparkle-engine",
"private": false,
"version": "0.0.8",
"version": "0.0.9",
"type": "module",
"files": [
"dist/*",
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import MathUtils from "./math/math"
import Animations from "./animation/animation"
import { DataResources } from "./loader/loader"
import Resources from "./loader/resources"

import Graphical from "./nodes/graphical"
export {
Resources,
Color,
Expand All @@ -49,6 +49,8 @@ export {
Sprite,
Text,
Collision,
Graphical,


TextureManager,
Texture,
Expand Down
6 changes: 5 additions & 1 deletion src/nodes/graphical.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { GraphicalType, ICircleOptions, IGraphicalOptions, IPolygonOptions, IRectOptions, Path, Rect, Vector2 } from "../main";
import { GraphicalType, IGraphicalOptions, Rect, Vector2 } from "../main";
import Drawable from "./drawable";

/**
* 绘制图形,圆形多边形,正方形等
* @category GameNode
*/
class Graphical extends Drawable {
type: GraphicalType;
path?: Vector2[]
Expand Down

0 comments on commit 6b0c8ed

Please sign in to comment.