GithubHelp home page GithubHelp logo

break-bricks's Introduction

打砖块

本项目代码托管在 https://github.com/Ultrasty/break-bricks

代码量并不算大,但是算上cocos引擎的学习成本还是花了不少时间的

熟悉了cocos引擎的各种API

[2020.09.01 01:59]学习教训:git commit之前一定要先在cocos里保存场景到文件中!因为这个很多进度丢失掉了... 不得不重做

远程部署

项目部署在ooblogs.com/game,也可以通过IP访问139.196.195.26/game,服务器为Apache/2.4.46 (Win64) PHP/7.4.9,此服务器将在9.28过期。

服务器的上行带宽为1Mbps,因此可能需要大概15秒的时间来加载界面。

环境配置

本项目使用cocos creator v2.4.2开发,其包含了轻量的游戏引擎,基于Cocos2d-x

参照官方文档https://docs.cocos.com/creator/manual/zh/getting-started/install.html进行环境配置。

其内容提炼如下:

https://www.cocos.com/creator/下载Dashboard,安装

打开Dashboard,下载2.4.2版本

然后在cocos creator中打开本项目即可查看,可以通过菜单栏的项目->构建发布进行项目的编译。

在压缩包中已经把项目编译好并放入build文件夹中,只要将build文件夹中的所有内容放入web服务器的目录下即可完成部署,通过IP+端口来访问

如果不通过服务器直接打开build文件夹下的index.html是无法启动本游戏的。

游戏说明

游戏设计在打砖块的基础上增加了一些趣味玩法,为了增加游戏难度,在游戏中设置了两个小球,红色小球的质量和白色小球质量一样,都为m,白色小球带正电并且处于方向向上的电场中因此受力平衡,做匀速直线运动,红色小球在重力场的作用下做变速运动,轨迹为抛物线。游戏中的所有碰撞均为完全弹性碰撞,两小球相撞遵循动量守恒定律,任意小球掉落出游戏场景均会导致游戏失败。按右上角暂停键可以暂停游戏。小球与板的边缘碰撞会根据矩形直角与圆形圆心的连线作为法线计算碰撞后的速度方向,据此可以人为改变小球反射角度。

break-bricks's People

Contributors

ultrasty avatar

Watchers

 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.