Day 22 at Makers Academy

More Battle and the HTTP Process

This morning we had a workshop talking about the process of http requests. We then had 15 minutes to work through 3 scenarios as a group and map out what the process was. Then we had to come back and act it out. I played the server, and I did a damn good job. We acted out passing messages between the client and server and explained what was going on. It was very useful in helping my understanding of how it actually worked.

After we did this, it made sense to start one of the practicals, in which we had to draw out the process of GET and POST requests. Here are my diagrams:

It was quite helpful to map it out like this and thing more about how internet browsers actually work!

I touched on the differences between GET and POST yesterday, although it was very basic, and not 100% accurate (Get can send messages to the server as well) so here is a much better guide to the differences and uses of the 2.

I carried on working on Battle for the rest of the morning. I managed to get to the end, however I had been pretty much blindly following the walkthrough, so I don’t feel like I learned too much. It does allow me to show you how it works though!

First you enter the names of the two players. One of the extra pieces of work was to add an option to play against the computer, I wouldn’t be able to implement that yet though with my current understanding.

I added colours and different font sizes to make it look nicer

Once you submit it takes you to the game page. There are 5 options for attacking, however at the moment they all do they same thing. Again it was meant to be an additional feature where you had options on what to do, I just haven’t got there yet. As you can see it shows you whose turn it is to attack as well.

Pressing attack brings you to this screen

Pressing the OK button brings you back to the game screen, but as you can see below, the turn has changed players, and Sam’s HP has gone down. The damage is random between 1 and 10.

Sam can attack in the same way.

Eventually one players HP goes down to 0, at which point the game over screen is shown.

It is very cool to have built something like this, however if I were to try again on my own I would have absolutely no idea where to start. There are lots of different syntaxes for testing and setting up your files which are very different to what we have been doing, so I need a lot more practice with this! Hopefully over the next few days I will get more comfortable with it. There is a practical to build a simpler web app which I want to try tomorrow to help my understanding.


Todays song of the day, there is going to be a few from this playlist this week:

Leave a comment