Make Minesweeper in C using Raylib | FULL TUTORIAL

Veröffentlicht am: 16 Januar 2024
auf dem Kanal: Erik Yuzwa
2,407
77

In this video tutorial, we're going through the process of creating a Minesweeper type of game from start to finish! We'll be coding it in the C language using the Raylib game library. We're also going to add in some sound effects, game states such as a Main Menu and Options screen and have a lot of fun in the process!

Minesweeper Rules
--------------------------------
A player selects a cell to open it. If a player opens a cell containing a mine, the game ends in a loss. Otherwise, the opened cell displays either a number, indicating the number of mines diagonally and/or adjacent to it, or a blank tile (sometimes shown as a 0), and all adjacent cells will automatically be opened.

👉👉Grab the source (on github): https://github.com/erikyuzwa/raylib-m...

🔗Links & References:
Raylib website: https://www.raylib.com/
Raylib github: https://github.com/raysan5/raylib
Raylib API Cheatsheet: https://www.raylib.com/cheatsheet/che...
JSFXR Sound Effects Generator: https://sfxr.me/
Music: https://pixabay.com/music/search/8bit...
DrawTexturePro Demo: https://tradam.itch.io/raylib-drawtex...

👋🏻Connect with me:
Twitter:   / eyuzwa  

🎨 Timestamps
0:00:00 - Introduction
0:00:43 - Minesweeper Demo
0:02:49 - Official Minesweeper Rules
0:06:38 - Create Project in VS 2022
0:07:24 - Setting Up main.c
0:07:54 - Stubbing out Game* Functions
0:10:36 - First Test
0:11:15 - Rendering our Tile Grid
0:12:17 - Creating our Tile Structure
0:18:19 - Placing the Mines in the Grid
0:21:36 - Demo of Mines in the Grid
0:22:25 - Calculating Nearby Mines Count
0:26:14 - Rendering the Nearby Mine Count
0:28:41 - Reveal Chosen Tiles
0:29:59 - Handling Left Mouse Button Input
0:35:29 - Testing LMB Click
0:36:00 - Handling the RMB for Planting a Flag
0:36:42 - Loading Texture Data from Image(s)
0:39:13 - DrawTexturePro
0:40:45 - Back to Handling RMB
0:43:07 - RevealTilesFrom a Tile
0:47:26 - Explaining Game State Machines
0:50:24 - Creating a GameState enum
0:51:22 - Updating GameRender with switch support
0:52:15 - Updating GameUpdate with switch support
0:55:03 - Rendering Main Menu
0:57:55 - Rendering the Lose Screen
1:00:06 - Rendering the Win Screen
1:02:22 - Adding Sound Effects and Music
1:08:42 - BONUS - Adding Audio Toggles and Options Screen
1:14:03 - Wrapping Up!

#raylib #minesweeper #gamedev


Auf dieser Seite können Sie das Online-Video Make Minesweeper in C using Raylib | FULL TUTORIAL mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Erik Yuzwa 16 Januar 2024 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 2,407 Mal angesehen und es wurde von 77 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!