snake设计图
2021-01-30 15:34:42 4 举报
snake设计图
作者其他创作
大纲/内容
Controller(手柄)
+ upState:State+ downState:State+ leftState:State+ rightState:State+ currentState:State
+ refresh():void+ up(): void+ down(): void+ left(): void+ right(): void
Block
+ x:int+ y:int
DownState
+ snake: snake+ controller:Controller
+ refresh():void+ up(): void+ dwon(): void+ left(): void+ right(): void
Canvas
<<abstract>>State
Scene
+ keyPressedListener(key)
Score
- score:int
+ add():void+ draw(GraphicsContext gc)
LeftState
UpState
Main
+ speed: int+ width: int+ height: int+ blocksize: int+ snake: Snake+ food : Food+ controller: Controller+ score: Score+ scene: Scene+ canvas: Canvas
+ start(Stage primaryStage):void
AnimationTimer(定时器)
+ handle():void
Food
+ x:int+ y:int+ color: Color
Snake
- blocks: List<Block>- tail: Block
RightState
0 条评论
回复 删除
下一页