◀ VibeCruiser

zombie

A free browser game — play it in your browser, no install. h5 game / h5 游戏 生存类游戏:试玩地址:https://lxjsoilor.github.io/zombie/index.html

by @lxjsoilor · lxjsoilor/zombie on GitHubLANG JavaScript★ 25HOSTED ON LXJSOILOR.GITHUB.IOUPDATED 1 Oct 2022

Made this, @lxjsoilor? See how many people played it → or use email

▶ Play full screen ▲ Vote: free account with email ▲ Or sign in with GitHub

GitHub may ask you to sign in, then to let VibeCruiser “Verify your GitHub identity” and “Act on your behalf”. We only read your profile and email, and never post anything.

Open the live demo Source on GitHub

From the README

碰撞检测:人物、怪物、子弹、道具拾取的碰撞基于canvas内部实现的isPointInPath()实现。 游戏引擎:自己编写的简易游戏引擎,实现了游戏循环、暂停、动画、行为、声音与图片预加载、向量与碰撞检测系统。

canvas是HTML5新增的组件,它就像一块幕布,可以用JavaScript在上面绘制各种图表、动画、游戏等。

游戏的开发离不开游戏引擎,比如比较火的有egret和cocos creator。但是我不是专业的游戏开发,游戏引擎就不用了,就单纯使用原生js加html5的canvas来搞游戏。

有兴趣的同学可以打开看看。

游戏主角怪物精灵表以及场景。

关卡选择(可以选择单人或者双人游戏).

动画就是通过切换显示每张精灵表的坐标和显示区域形成的,用Photoshop的时间轴模拟下: 然后我们就大概知道精灵表用来做啥的了。后面我们就要用代码实现这样的动画了。

最后是声音素材的收集,百度:游戏声音素材。然后慢慢挑选。。。。

整个程序实现了基本的游戏引擎,碰撞检测和追踪算法并且基于canvas绘制。

images 文件夹用于存储游戏过程要用到图片。 sounds 文件夹用于存储游戏的音效。

游戏实现原理和游戏循环的实现。

Read the full README on GitHub →

Built something like this? Submit your vibe — free account, takes a minute. How listing works.

More like this

Made this?

Claim it: create a free account, then press CLAIM THIS in the cruiser. Put the badge below in your README or on your demo page first; that link is how we know it's yours.

Your project is on the cruise, loaded live from your own site. Put the badge in your README or on the demo page: it shows your live play count, it links back to this page, and everyone who lands here is one click from running the real thing.

On VibeCruiser

How listing, the badge and claiming work →