Code Monkey home page Code Monkey logo

shootinggame's Introduction

ShootingGame

  • 射击游戏练习,注重游戏设计和Shader特效

操作

  • 移动:左右方向键
  • 冲刺:左Shift键
  • 跳跃:空格键
  • 射击:X键

游戏设计

  • Doc/30个让游戏更有感觉的小技巧.md

待做

  • 跟踪弹
  • 连锁闪电
  • 武器切换
  • 命中敌人改成用回调而不是依靠碰撞

Shader

  • 人物受击白光

    • 原理:渲染多一遍角色(Graphics.DrawMesh),只渲染指定颜色
    • 文件:"Assets/Shader/OnlyColor.shader"; "Assets/Scripts/Effect/ColorEffect.cs"
  • 尸体(子弹壳)消融

  • 震荡波动(子弹碰撞)

    • 原理:球体通过GrabPass获取屏幕纹理,读uv时,加上球体法线外扩,噪声纹理偏移;缩放,透明
    • 文件:"Assets/Shader/BlastWaveEffect.shader"; "Assets/Scripts/Effect/GoEffect/GoBlastWaveEffect.cs"
  • 震荡波动2D(开枪火花)

    • 原理:读纹理,偏移GrabPass
    • 文件:"Assets/Shader/BlastWave2DEffect.shader";
  • 遮挡高亮(敌人被墙体挡住)

    • 原理:多渲染一次,不写入深度就好了
    • 文件:"Assets/Shader/OcclusionHighLight.shader";
  • 遮挡消融(玩家被墙体挡住)

  • 残影(冲刺幻影)

    • 原理:用CombineInstance合并所有子网格,每次更新设置一下转换矩阵调整位置,然后调用DrawMesh渲染这个网格。
    • 文件:"Assets/Scripts/Effect/GoEffect/GoGhostEffect.cs"
  • 能量护盾(敌人概率自爆冲击波)

    • 参考:https://zhuanlan.zhihu.com/p/35922906
    • 原理:边缘高亮,相交高亮(计算场景深度 和 自身坐标深度比较 如果相近 说明接近相交处)
    • 文件:"Assets/Shader/TransparentShield.shader";
  • 击中弹痕

    • 参考:Unity官方粒子特效Demo
    • 原理:射线命中点创建贴花特效,设置朝向为命中点法线方向。

待做

shootinggame's People

Contributors

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