Code Monkey home page Code Monkey logo

games's Introduction

Games


该游戏提供两种运行方法

  1. 直接运行游戏主体
    这种运行能玩到游戏的绝大部分内容,不需要注册用户,基本上不需要配置环境,是一种简单的运行方法.
    进入Games/WebContent目录,使用python2.7运行webserver.py,命令如下:
python webserver.py

然后打开浏览器,在地址栏输入127.0.0.1:8000,就可以进行游戏了.
2. 运行完整的项目 运行完整的项目,你会看到更美观的页面设计,需要注册登陆,可以冲击排行榜.
如果你想要运行完整的项目,你必须先配置好环境,然后打开网站,注册账号,才能开始游戏,如果你足够厉害,就能进入游戏的排行榜.
配置环境

  • python版本:python3及以上,最好是python3.5
  • Django版本:Django1.10.1 导入Django,推荐使用pip导入Django,命令如下:
pip install Django==1.10.1

详情请访问Django官网.

  • BootStrap版本:BootStrap3.3

请到BootStrap官网下载最新版本的BootStrap
bootstrap.min.css拷贝到Games/Invaders/static/Invaders/css目录下,将bootstrap.min.js拷贝到Games/Invaders/static/Invaders/js目录下,命令如下:

# xxx为bootstrap文件目录.比如说 ~/Download/ ,yyy为该项目的保存目录
$ copy /xxx/bootstrap-3.3.7-dist/js/bootstrap.min.css /yyy/Games/Invaders/static/Invaders/css
$ copy /xxx/bootstrap-3.3.7-dist/js/bootstrap.min.js /yyy/Games/Invaders/static/Invaders/js

当然你也可以直接用鼠标复制粘贴bootstrap的css,js文件到游戏的相应目录下.

运行游戏
打开终端,进入游戏目录,运行游戏,命令如下:

# yyy为该项目的保存目录
$ cd /yyy/Games 
$ python3 manage.py run server

打开浏览器,在地址栏输入127.0.0.1:8000/Invaders/,就可以游戏了.

games's People

Contributors

addliu avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.