Hazel game engine (059-060) completes a small game in 1 hour

If there are errors in the code, terminology, etc. in the text, please correct me

foreword

  • What this section does

    Cherno has completed a small game with the current hazel engine, and this small game will be explained in this section

  • realized mini-game

    A lot of basic math plus logic was used.

    The functions that the current engine does not have are all added by Cherno in the game, such as particles and collisions.

Highlights

graphic glow

a special triangle texture

Handles triangles blending with triangle-shaped edges without being cut off

  • cut off effect

    Please add a picture description

  • not cut off

    Please add a picture description

  • Related processing code

Discoloration of obstacles

  • The code controls hsvtorgb, and then uploads to opengl

Linear dimming from the center of the rocket to all sides

  • glsl code

  • Remove dist = sqrt(dist), the range of light becomes smaller and darker

  • Changing sqrt(dist) to dist * dist will make it darker, which is equivalent to reducing the brightness range

  • Please add a picture description

text output

The score in the upper left corner is output with the Api of imgui

060Hazel2020

  • I want to turn Hazel into a real game engine, which has a graphical interface, and can easily and quickly develop games like flybird
  • From the development of the small game in Section 059, reverse engineering should be used to move the functions of this small game to Hazel, including collision, particles, and GUI
  • Optimize the code of the 2D rendering API to achieve batch rendering .

Guess you like

Origin blog.csdn.net/qq_34060370/article/details/131882883