![]() ![]() Now that we’ve got an empty window on the screen, let’s take a step back and talk about the game. Especially if that “something” is… an empty window. That was easy, right? MonoGame, like XNA before it, makes it exceptionally straightforward to get something on the screen. You should see an 800圆00 window, cleared to black. Hit “Start” in the toolbar, or press F5, to run it. Open MakeSantaJump let main argv = use g = new MakeSantaJumpGame () g. Right-click Program.fs, then “Add Above” > “New Item…”. We’ll write all our game code in a new file, and keep Program.fs mostly empty. If we leave it as Console Application, it will still work, but it will show a console window behind our game window.) (I don’t know why there isn’t a Windows application project template, which would save us this step. In the Application tab, change the “Output type” to “Windows Application”. Next, right-click on the project in Solution Explorer, and click “Properties”. Click “Install”, wait for it to install, and then click “Close”. ![]() At the time of writing, the current version is 3.2.0. The package you want is MonoGame.Binaries. In Solution Explorer, right-click on “References”, and click “Manage NuGet Packages…”. Choose “Console Application”, give it a name, and click OK. On the left, under Templates, choose “Other Languages”, then “Visual F#”. If not, grab the free Visual Studio Community 2013 and install it. I’m also assuming, if you’re reading this, that you already have Visual Studio installed. As I mention at the end of this post, the game should work without too many modifications on Mac and Linux, but for now, it will be easiest to follow along if you’re on Windows. I’ve made the assumption, for the purposes of this tutorial, that you’re using Windows. Our whole game will be only 300-ish lines of F# source code. I’ll include all of the necessary code here, and we’ll work our way right from the beginning to the end. If you haven’t worked with F# much or at all before - no problem. Or put another way, we’re going to write the game from scratch, using only A HIGH LEVEL LIBRARY THAT DOES BASICALLY EVERYTHING FOR US. We’re going to write the game from scratch, step by step, using MonoGame. Okay - now that you’ve (hopefully) played the game, you’ve got a good idea of what we’re going to build. If you manage to score more than 0 on the highest difficulty level, you’re doing great -) In keeping with the original, I’ve pitched the difficulty somewhere between “fiendish” and “nightmarish”. Try to get as high a score as possible! And then leave your score and difficulty level in the comments below :) Then press the key in the top-left corner of each panel (Space, F, etc.), to make the corresponding Santa jump. There are 5 difficulty levels on the menu screen, press the number key corresponding to the difficulty. Unlike some of the other #fsadvent entries, the code for this game is not particularly clever or advanced but the end result is, hopefully, enjoyable.īefore we go any further, I recommend that you download the finished game from GitHub (download “” to get the pre-built binaries) and try it out yourself. When Sergey Tihon asked for volunteers for the F# Advent Calendar, I knew I wanted to do something related to games, and I decided it would be fun to make a Santa-themed clone of Make Them Jump. Here’s a short, poor-quality video that I took with my phone (it’s harder than you might think to take a video with one hand while playing a game with the other hand):įor the last couple of months, I’ve been addicted to Make Them Jump, an awesome game for iOS (and Android). And for a game that’s taken about 5 hours to put together, it’s pretty fun to play, if I do say so myself. It looks even better in action, if that’s possible. It’s the holiday season, so let’s make a game.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |