Check out Miniroll.app, a way to create, share, and explore blogrolls!

Posts

Serpentine - My Snake Clone

I created my first ever snake clone! It was a quick entry for Ludum Dare #34, just because I wanted to enter something, and it’s something I’ve never done before.

So I went with a basic 4 colour palette, in the style of old GameBoy games. And also super simple graphics, so everything is square blocks.

It’s my first SpriteKit game as well which is nice, because I’ve been meaning to actually use it for a while. So hopefully I use it again soon!

Here is what the game looks like:
SNKE_2

You can view the Ludum Dare entry page for the competition version, or if you want the more updated version then check out Serpentine on itch.io. I’ll probably add a bit more to Serpentine in the future, so if you want any updates it’s probably best to follow me on twitter @chrishannah.

Cool Things to do in Terminal

I’ve been playing around with Terminal recently (the command line interface for Mac), and I’ve come across a few cool things you can do with it. So here they are.

1. Watch Star Wars Episode IV

Star Wars
Yes, you can watch the first Star Wars movie straight from Terminal. The whole thing is in ASCII code, and it looks pretty good. I probably shouldn’t admit this, but I put this on in one of my rather boring university lectures. All you have to do is type:

telnet towel.blinkenlights.nl

You can do this in Windows as well, but sometimes you have to enable Telnet on your machine first, so here is a guide for that.

2. Play Retro Games

Screen-Shot-2015-11-09-at-22-18-10
You can play some very cool retro games right inside your Terminal window, and it’s pretty easy too. Just type in emacs, press Enter, then press “Esc + X”, and then you can type in the games you want to play. Here are a few of the games:

  • tetris
  • pong
  • snake
  • solitaire
  • gomoku
  • 5×5
  • dunnet
  • landmark
  • doctor

3. Talk to a Doctor

You can also use Terminal to talk to a virtual psychologist! Use the same steps as above, but instead of typing a game, type “doctor” (without the quotation marks).

4. Set a Start-up Message

Add some personalisation to your Mac by adding a start-up message. Type the following, replacing Message with the desired text.

sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Message"

You’ll be prompted for your password. I have mine saying Hello to me every time I turn my Mac on. To turn this off just type:

sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText ""

5. Add some space to your Dock

Screen-Shot-2015-11-09-at-22-23-19
If your finding your Dock a bit too cluttered, you can add some extra separators to space out the icons a bit more. Copy this into Terminal to add a new separator:

defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock

To remove it, just drag it out of the Dock.

6. Make it Speak

This is a pretty easy one, and although probably isn’t very useful, it’s quite fun! Just type say followed by the text you want it to say, and then press Enter.

7. Prevent your Mac from Sleeping

There are some apps around for Mac that stop it going to sleep, like Coca and Caffeine. But if you want to do it in Terminal instead, then there’s just one small bit of code you’ll need to know: caffeinate -u -t 3600 To change the amount of time to prevent sleep, just change the value where it is 3600. It is measured in seconds, so the code above will keep your mac awake for an hour.

From Ideas To End Users

I’ve just experienced something so strange to me that I want to share it with everyone.

Background Information

I’m a programmer, I enjoy making games. I am not perfect at it and the games I make I can always improve. It’s the making the game that i find fun and that I can actually create something that works.

So what happened?

A while ago I was entering Ludum Dare (48 hour game development competition), I made my first game “I’m Where”. That was incredible for me as it was my first completed game and that is was released to the public was even better. Fortunately, the people I showed it to liked it! There was problems, but that was expected from a beginner and also from 48 hours.

So because of that I went on to enter the next competition, I chose to do a game of the same style as before (top-down, pixel art, thing), and I tried to make it bigger and more interesting.

The game mechanics were mostly the same, you could open doors, press switches, read signs, move stones, use keys, etc. But I got that out of the way first and then I went on to level design and created about 20 different levels and each one I designed from scratch.

I enjoyed making every part of this game, and i also got some good comments and feedback like my first entry. This was amazing.

Now the strange part

Now it’s about a year after I made the games (I have had one more entry but nothing special). I was sitting in the living room with my brother (15) and my sister (21), we all have MacBooks so we were having fun with AirDrop and seeing what we could send to each other.

While in Finder, I found a compiled .app of my second entry “Tinius Worldifica”, so straight away I said “See if this works, it’s something I made”.

I then carried on my usual internet activities, probably watching videos or scouring social networks. And I turned round and both of them were playing my game!

It was the strangest feeling ever.

I found it odd at first that they wanted to play it as it was just a test for AirDrop, and at best they might open and close it. This was about 10 minutes in, my sister was stuck right into it and I could tell she was thinking about the puzzle and how to complete that level.

Although I have had comments about the games I make, I have never seen anyone play them and it is incredible and it is something I heavily encourage.

I asked her why she was still playing it, she replied “It’s addicting!”. So I then watched her play the rest of the levels and eventually she gave up but this was really far in the game and that was good enough for me.

But what the thing I couldn’t get my head around was this – When I play a game I created all I see is the code for each function, each object and how they interact. I also see each tile map as individual .pngs and it feels like a big jumble of information, with loads of possible improvements.

But if you don’t have a part in developing the game and you don’t see what went into it, you have an entirely different mindset. They saw it as a finished game, something ready for anyone to just open and play.

I can’t emphasise this enough, watching someone interact with a product you have put effort into (Only 48 hours I know, but it was a straight 48 hours work), is the most amazing awesome and fascinating experience you can have.


So if you have every created something, share it! And try to be there when they use it, you’ll be amazed.

Sudo Fresh Start

I’ll start this off by telling everyone my bad news, my MacBook Pro seems to of died. The hard drive is clicking, and it’s failing to boot. I’ve also got a suspicion that there could be more faulty, as I’ve tried some stuff which should still work with a failed hard drive, but with no luck. I’m not coming to any conclusions yet, because I haven’t had a proper research yet, but I’ll see what I can do.

That leaves me with only two real devices I can use, my iPhone and my iPad (which I’m using to write this). I suppose my iPad lets me still carry on writing, browsing the web, watch videos, etc. But I feel limited when using these devices, in a way that just doesn’t happen with a Mac.

If I deem the repair of my Mac to be not worth it, then my only choice is to upgrade. And at the minute my favourite is the 13″ Retina MacBook Pro, I would have to go to a store to compare the models though. I would only upgrade at the end of this month, so as to give me time to check if I can fix my current Mac, and to decide on upgrade if necessary.

Time without a laptop could be beneficial for my iPad though, as I’ve probably not been using it to its full potential. And with iOS 9 already installed on it, I can test the new features designed to make the iPad more of a device aimed at content creation, not just consumption. Two main things I can’t do on an iPad however are developing apps and games! Two things that I very much enjoy doing.

Luckily for me, I have a NAS drive which I have Time Machine on taking backups. I can’t say it’s been doing them regularly, but I have a backup from a few weeks ago that will be more than sufficient. Plus there’s the added benefit of iCloud, which hosts all of my music, photos, videos, etc. So I’m not worrying too much about losing my files.

I do think a new MacBook would be useful to me though, as it allows me to have a fresh start albeit a forced one. It would probably be more of a psychological clean slate, but it would allow me to focus on what I really need in a device and not mess this one up. The new models also come with integrated flash storage, so that is a major advantage over the basic one my current Mac. Then there is the retina screen, better graphics, better processor, so it would put necessarily be a like for like replacement.

I think I’ll have to re-evaluate my backup strategy as well. I’ll set up my Time to do backups more regularly, but I also want to add a second layer of protection at least. This could be where a fresh start would come in handy, as it would allow me to start using a service like Dropbox, to host all my valuable files for my blogs and also university. And that would be a lot easier to set up if I started from scratch.

Well there are my thoughts on the situation, sorry if I’ve bored you in the mean time. But I thought I needed to let it all out.

If you have any suggestions on the repair, which model to upgrade to, or even ideas for how I will set up a replacement, then please post a comment. I’m always eager to listen to other opinions.

Kitten Killer

I’ve just finished another game, for Ludum Dare which is a 48 hour game development competition. The idea is to start with a blank slate, and a theme, and then you have 48 hours to create everything and to create a game. The entries are then rated by other game developers and after three weeks, you get to see where you ranked.

My latest entry was “Kitten Killer“, a game where you have to kill as many kittens as possible in 60 seconds. It may seem horrific, but the theme was “You are the monster” so I thought it was very suitable.

It only finished Sunday evening so I have a while left, but it’s already started to receive very positive comments.

You can play Kitten Killer on itch.io.

Watching The Perseids

Tonight I watched some of the Perseids Meteor Shower in my back garden, and I just want to share my experience. Just in case you didn’t know, the Perseids are a meteor shower which typically appear in August. If you want to learn more then I’d recommend reading this BBC article for starters. Although I didn’t have the best viewing conditions (it was a bit cloudy), I managed to watch a few meteors fly past, and generally see a lot of stars.

Music

I couldn’t do this in silence, so I consulted Apple Music. I found a very apt selection in the “Being Outdoors” section of their activity playlists, I listened to one called “Under the Stars”. I generally found the music to be okay, but my attention was mainly on the stars. One song I did like was “Ladies and Gentlemen We Are Floating In Space” by Spiritualised.

Photography

Of course I had to do some photography while I was there, I’m no professional though I do admit. I used my Canon EOS 1000d with a 50mm prime lens, pointing directly up from where I was laying. I used an app called DSLR Assistant for Mac, which is fantastic in my opinion. I didn’t spend too much time getting the perfect shot, as I was more focussed on seeing them with my own eyes. I haven’t edited the photos in any way at all, they are straight from my camera. Here is a shot where I actually captured part of the shower. And here is a 4 second video of 60 different photos that I took. Just to be clear, the photo gets slightly orange at the end as a street light decided it was a good time to turn on. Hopefully, it still looks okay

The Heart of a Black Hole

There is a reason why you cannot see the “Heart” of a black hole, but first I will explain what it really is.

A black hole is a region of spacetime from which it’s gravity force prevents anything, light, etc escaping. It is predicted in the theory of general relativity that a sufficient amount of mass compacted will create a black hole. They are incredibly small with a huge amount of mass.

Around a black hole you have what is called an event horizon. This is more commonly known as the point of no return, as once you get past that there is no way (without travelling faster than light) you can escape.

At the centre of black hole there is something known as spacetime singularity. This is a point in spacetime where the quantities used to measure the gravitational field become infinite.

Time Dilation

This is the reason why we can’t see the heart, time dilation.

It all comes down to large quantities of mass warping space-time, causing the gravitational field becoming stronger, slowly pulling objects towards the center. Meanwhile, bending spacetime in a way that time appears different to observers outside of the field to those closing in on the event horizon.

As time is all relative, we interpret time different than each other. Meaning one person can measure time in a certain point in space, but someone else can be travelling through a part of time that is warped can be measuring time as well. But if they observed each other, time would seem different.

The Heart of a Black Hole

Imagine you had 2 people, one person was at a safe distance watching the black hole, the other was slowly approaching the black hole.

For the onlooker, the person travelling towards the black would be gradually travelling slower and slower. The person moving towards the event horizon will see time relative to his position in time and space, meaning time will seem normal to him and not appear to have slowed at all.

When the traveller reaches the point of no return (event horizon), he will first be broken down to the atomic level (see “Spaghettiication”), and then from on lookers time will appear to have stopped. After that, because no light can escape the black hole, he will appear to be paused on the event horizon.

So while, the onlooker will forever see the man paused at the edge of a black hole. The man will have actually broken down and compacted into the singularity of the black hole. And relative to him (or whats left) time will appear to passing normally.

If you want to learn more about this, Brian Cox explains it in the recent BBC programme “The Science of Doctor Who”, which can be viewed here.