The reason we do it this way is so we can add as many coins as we want, without needing individual if statements for each coin. Here, we need a for loop that runs until our coinVec‘s size, which is then followed by an if statement that checks if our player is colliding with the current iteration of coinVec. I encourage all to use the one I created in 2016, which you can find here, that looks like this: # include # include int main ( ) Once you have everything properly setup, it’s a good idea to start all SFML projects with a template that creates a basic window and gets a main loop running (in your Main.cpp file). This post will not show you how to do that, but for all using Microsoft Visual Studio, you can watch this tutorial by Richard Phelix that is still working in 2017 and you can download SFML here. To begin, you must have the SFML graphics library setup properly on your development environment. This article will be on how to build a very basic platformer game in C++ using the SMFL graphics library.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |