1
0
Fork 0
mirror of https://github.com/eXpl0it3r/SFML-Workshop.git synced 2026-01-01 11:02:58 +00:00
Example code for the SFML Workshop
Find a file
2024-05-01 15:35:06 +02:00
.github/workflows Simplify the GitHub Actions setup 2024-05-01 13:10:55 +02:00
01-Setup Update CMake files and remove VS projects 2024-05-01 13:10:53 +02:00
02-Movement Update CMake files and remove VS projects 2024-05-01 13:10:53 +02:00
03-Structure Clean up header file includes 2024-05-01 13:22:03 +02:00
04-Sprite-Texture Clean up header file includes 2024-05-01 13:22:03 +02:00
05-Map Clean up header file includes 2024-05-01 13:22:03 +02:00
06-Entity Clean up header file includes 2024-05-01 13:22:03 +02:00
07-Audio Clean up header file includes 2024-05-01 13:22:03 +02:00
08-Text Enhance the text example slightly 2024-05-01 15:35:06 +02:00
assets Add basic Text project 2019-06-11 00:44:50 +02:00
.gitignore Remove the libs directory 2024-05-01 14:54:52 +02:00
CMakeLists.txt Update CMake files and remove VS projects 2024-05-01 13:10:53 +02:00
LICENSE.md Update CMake files and remove VS projects 2024-05-01 13:10:53 +02:00
README.md Enhance the text example slightly 2024-05-01 15:35:06 +02:00

SFML Workshop

This repository holds the example code originally used for a SFML Workshop at the C++ Usergroup Zentralschweiz. If you find something to improve, don't hesitate to reach out or send a pull request.

01 - Setup

The most basic game loop using SFML.

  • Basic game loop
  • sf::RenderWindow
  • sf::Event

02 - Movement

Move are a colored rectangle one keyboard button press at a time.

  • Clear, draw, display
  • sf::RectangleShape
  • sf::Keyboard
  • sf::Event::KeyPressed & sf::Event::KeyReleased
  • sf::Vector2<T>

03 - Structure

Scope the application inside a class, thus allowing to share variables across multiple functions.

  • Basic game structure

04 - Sprite & Texture

Replace the colored shape with some picture.

  • Resource management
  • sf::Sprite
  • sf::Texture

05 - Map

Render the map based on fixed integer values.

  • Basic map handling
  • sf::Drawable

06 - Entity

Box entities need to be rendered separately.

  • Collision detection
  • Enum for types

07 - Audio

Play some background music and make some noise when moving.

  • sf::Music
  • sf::SoundBuffer
  • sf::Sound

08 - Text

Display a 'You Won!' text when the win condition is reached and show the steps taken.

  • sf::Font
  • sf::Text

License

This software is dual licensed under the Public Domain and the MIT license, choose whichever you prefer. See the LICENSE.md file for more details.
Note: The used assets do not fall under this license, but they are all licensed either CC0 or in the public domain