Sublime Text 移动 前端 Python Android Java

谁说Sublime不能做小游戏?

2017-06-30  本文已影响82人  Floyda

github: game-of-tetris

一图胜千言

tetris

缘起

群里有人问, Sublime能不能做点好玩的东西?
当然能啊!

技术分析

本质上是一个Sublime的插件, 用现有插件的API, 来实现一个小游戏.

输入

    { "keys": ["up"], "command": "tetris_operation", "args": {"operation": "up"}, "context":[
        { "key": "setting.isGameTetris", "operator": "equal", "operand": true }
    ]},
    { "keys": ["down"], "command": "tetris_operation", "args": {"operation": "down"}, "context":[
        { "key": "setting.isGameTetris", "operator": "equal", "operand": true }
    ]},
    { "keys": ["left"], "command": "tetris_operation", "args": {"operation": "left"}, "context":[
        { "key": "setting.isGameTetris", "operator": "equal", "operand": true }
    ]},
    { "keys": ["right"], "command": "tetris_operation", "args": {"operation": "right"}, "context":[
        { "key": "setting.isGameTetris", "operator": "equal", "operand": true }
    ]},

输出

其他则是游戏的实现过程, 和Sublime无关(略)


EOF

上一篇下一篇

猜你喜欢

热点阅读