Giter Site home page Giter Site logo

tetris's Introduction

Tetris

这是一个给AWS的ELB功能设置的游戏例子
是从网络上一个单机的H5 俄罗斯修改过来的,用来证明AWS的ELB可以支持TCP和Websocket功能

先介绍下工程
/views/h5Russia_single.html 单机例子
/views/h5Russia_server.html 游戏主客户端,websocket的操作发起,可以多发起,可以多操控,会出现交叉管理游戏的可能
/views/h5Russia_client.html 游戏从客户端,webscoket的多端接入,只能观看

游戏进入以后
localhost:8088/game 映射主客户端
localhost:8088/watch 映射从客户端
localhost:8088 映射单机

系统是beego完成的,因为考虑未来容器化,选择go作为后台语言

开发过程如下:
aws Assignment 3任务如下:
1、寻找一个h5单机俄罗斯方块
2、修改客户端和服务器代码,服务器用go语言实现,所有运算转入服务器完成(这是游戏持有状态的主要原因,因为需要**分发)
3、建立服务,建立EC2主机,建立ELB模式设置端口支持http和websocket模式(主要就是用ELB支持websocket,就是同时支持TCP_UDP模式,贯穿8088端口)
4、登陆服务器,安装环境和下载程序编译,执行
5、可以访问游戏,可以通过左右和空格控制游戏,进入画面3秒进入游戏,死亡结束可以刷新,未死亡则需要继续游戏

游戏多平台移植工程化是我硕士毕业的方向,具体的游戏还有一些bug,都和网络属性有关,比如TCP粘包,包限制控流,异常处理,比单机复杂,但是总体来说功能基本实现
我会在月底前清理所有相关的云主机配置信息

游戏者模式(可以多开,但是只支持第一个用户,后面的都是watch模式但是可以有控制能力)
http://111-5351c565dbdeac4f.elb.ap-southeast-1.amazonaws.com:8088/game (2020.7.30关闭)
观察者模式(可以多开,无控制能力)
http://111-5351c565dbdeac4f.elb.ap-southeast-1.amazonaws.com:8088/watch (2020.7.30关闭)
单机原始文件(单html)
http://111-5351c565dbdeac4f.elb.ap-southeast-1.amazonaws.com:8088/ (2020.7.30关闭)
github代码
https://github.com/Jugendreisen/Tetris
视频录像测试
https://v.youku.com/v_show/id_XNDc2MzI5NzU1Ng==.html

各位出海的游戏咖门,可以测试下,使用的新加坡方面的主机,要做好还必须优化网络配置什么的,
enjoy:)

tetris's People

Contributors

fv0008 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.