This article is part of the series “Game from scratch with C++ and SFML”.
2) Our first window & game loop
3) The state manager (Coming soon)
4) Adding our player (Coming soon)
5) Cleaning up with an object manager (Coming soon)
6) Add the ball (Coming soon)
7) The AI ! (Coming soon)
8) Finishing up the game (Coming soon)
In this chapter, we are going to create an application, open our first window using SFML and code our game loop.
To be original, we will develop some kind of “Hello world” program for now.
Hi! In this series, we’re going to create a Pong clone from scratch (almost) using SFML 2.5 and C++. Here is a demo of what we’re going to build:
Even though I always loved game development, when I started to work I quickly got no time left for it. After a while, I decided to start again from scratch and to share my experience along the road.
The obvious choice for creating a game in 2021 is to use a game engine. But if you’ve read some other of my articles, you know that I like to complicate my life…
Drag & Drop may sound scary for some developers. Actually, the built-in Drag & Drop HTML API is pretty straightforward.
Let’s see how we can easily build a sortable table using angular and drag & drop HMTL API.
In this article, we will assume that you’re already familiar with Angular 2+.
We will start by creating an empty Angular app using the following command:
ng new angular-sortable-table
We don’t want to spend too much time on the CSS here, so let’s add bootstrap CDN in our
index.html file :
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"/>
We want to display a simple list of…
Writing clean code is an important part of being a good developer. Like a good book or newspaper, your code must be easily readable and understandable.
The goal is to keep to a minimum the cognitive effort required to iterate on your code.
Don’t hesitate to spend time testing stuff and rewriting it.
The clearer your code is, the fewer bugs it will hide, and the less time it will take for other developers to understand it.
If it feels like you don’t have the time to focus on writing clean code, think about the time you will take away…
When we think about computers, we think about the last decades, maybe the last century at best …
Did you know that the story started about 4000 years ago ?
Obviously, we are not talking about modern computers here. But those items and ideas led to where we are today.
Computer science is closely related to Maths. The first computing device that we know of is the Sumerian Abacus.
It was created in 2700–2300BC by the Sumerian in the Mesopotamia area. Which means, it was created by the first human complex civilisation !
The Sumerian Abacus is a clay board…
If you ever wanted to create triangles using CSS, you probably found code samples on stack-overflow or css-tricks. But how do they really work ?
Understanding the process behind creating triangles will unlock a world of possibility for your css shapes.
In this article we will focus on explaining two methods that are often found on tips and tutorials.
To understand how triangles using borders work, we need to understand how borders work.
Let’s create a square with borders :
<!-- HTML -->
<div id="bordered-square"></div><!-- CSS -->
Mongoose populate allows you to replace the specified paths in the document with document(s) from other collection(s). It is well known and well documented. If you are not familiar with it, I recommend you to read the following before continuing https://mongoosejs.com/docs/populate.html.
When you look up this method, most tutorials use it like the example given in the official documentation. From my experience, this is a mistake. The documentation is here to display how the method works, not to give architecture guidelines. You should see it as a tool to use in your database architecture choices.
Whether you are a back-end…
I love beautiful code and well structured projects 😍 But as a freelancer, one thing I learned the hard way is: Developers are the only ones who care about beautiful code.
What matters the most is the short term business application. Where do we go from that? How to reunite clients/company needs, and beautiful, maintainable code?
In this article, I’m going to share my answer to that question related to API testing.
Most articles and tutorials recommend unit testing. I found them time consuming and hardly applicable to real business projects in the long run.
When you write an API…
While working on a game project in TS, we found ourselves needing a PNG decoder to create our objects metadata from pictures in a generic way.
We are coding using TS/JS in the browser, so the obvious solution is to use Canvas, but that wouldn’t be fun wouldn't it? So I decided to lookup the PNG format to create a decoder that will fit our needs.
Other than the official documentation, which can be heavy to read at first, i didn’t find much examples of how to implement that quickly, so I decided to share my experience and I hope…
After a while away from this framework, I recently went back to using Meteor. It has a lot of interesting features and I like how fast you can prototype with it, but for some really easy thing, I find myself stuck for too long.
The last thing that made me lose quite some time was the following problem : “How to easily add a city input to the registration form with autocomplete ?”
The most obvious solution that came to my mind, and that internet suggests, is to override the entire registration form, but I find that it’s overkill and…
Software engineer at Achiev & Jounco