RSS Feed

Game Programming: My First Steps

Posted on

windows blue screen

Or, laugh at the noob who doesn’t know a thing about computer game coding.

I’ve decided to embark on a journey. I don’t doubt it will be a long one, and many people will make fun of me for “doing this for fun”. But I like a challenge, and I like computer games, and I like coding, so when you think about it, this was inevitable.

My first step was to discover what language PC games can be written in. Apparently: C\C++, C#, Java. I won’t write it in Java, because my experience with Java-written games is Minecraft, and that noms the CPU. So, C#, with a little aid from things like OpenGL (how I learn to use this will be a hilarious adventure, I’m sure).

I’ve been recommended that before launching into C#, I start from the basics: C. Whic led me to , a cornucopia of handy tutorials. Then I had further misadventures while trying to find an IDE that could compile. After stumbling around with the command line for a little while, and downloading cygwin, I was still at a loss as to what to do. It seemed that anything resembling a tutorial written by either Linux developers or Software developers was a nightmare to read and/or understand, and they knew it, too. I actually came across one that started with, “This information is not meant to be comprehensive. If you are looking for a comprehensive guide, please look elsewhere.” Baffled, I soon became frustrated with the internet and was ready to give it up for another day when I found it. The golden ingot, the Holy Grail, the needle in the haystack, that tutorial and IDE I had searched so long for: NetBeans. Within minutes I was up and running with a C\C++ development environment that not only coloured the words correctly, it compiled, built, and ran.

So now that I have the will and the way, all I need to do is make this computer game. Easier said than done is entirely an understatement.

Website Redesign Release

Posted on

It is done!

From now on, all blog posts will be posted at my new web design portfolio. It’s nifty!

Easy and Awesome jQuery Plugins: Sortable

jquery sortable plugin

jQuery plugins that require little effort to install and achieve an impressive effect.

We’ll start with jQuery Sortable, part of the jQuery UI (User Interface) family. On a recent project (featured in the image above), I used this plugin to customise the order of fields in a form (this required a bit of javascript and PHP as well, don’t worry about that).

Right. So, on the Sortable page, you’ll see a list of items on the right with which you can preview different sortable options. I used the most basic form, with one change – I used the CSS snippet for better usability:

cursor: move;

Other than that it’s all vanilla.

When you click on the download page, you can see the entire plugin is customisable. After downloading, include your jQuery UI file and your jquery.js file in the <head> section of your HTML document (REMEMBER: jquery.js comes BEFORE any plugins). The easiest way to implement it the first time is to just copy the source code from the demo (expand the link “view source”) and go through it.

We start off with the jQuery call:

$(function() {
$( "#sortable" ).sortable();
});

Easy, huh? All it’s doing is looking for a list with the id of “sortable”. So what does that mean? It means you have to make a list with the id of “sortable”!

<ul id="sortable">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
<li>Item 7</li>
</ul>

And done! You may note that there some options you can implement. All you have to do is list them in the jQuery call, like so:

$('#sortable').sortable({
disabled: true,
axis: 'x',
grid: [50, 20]
});

Be sure that the last item on the list does not have a comma, just like populating an array.

I hope this post encourages you to try new plugins and realise how a little interaction can improve usability greatly.

Design Rethink

danaemc web design

Well, that old design didn’t last long!

But really that’s fine because I’ve already mocked up and front-end-coded the home page of my new design. Above is a wee teaser. The interesting texture you can see was made from a couple of photos of ice. You may notice the logo on the top left – I’m trying out my brand of sorts. You can see it as my avatar on twitter.

Up the top right are two of four icons: WordPress (probably become redundant after my portfolio is finished), Twitter, Behance and an RSS feed. You can see a bit of a small thumbnail viewer (what will be projects and portfolio examples).


If you are interested in my design process, here’s a quick overview of what I’ve done so far.

Usually I start out with a sketched mockup on paper. For this one I used the layout from my design I mentioned a couple of posts back. Then I went straight to Photoshop. I used the 960 Grid System to set guides. I used the “Add Noise” filter to create the background pattern, and the aforementioned ice photos set to “Color Dodge” for the header background. Font choice was easy; I love Georgia. Be sure to set the font style of smaller-sized text to “None”; this way you get a more accurate representation of what will eventually appear on your screen. You can’t see it in the sneak peek, but I drew up a bird outline for part of the Twitter feed. I’ll try to remember to make a tutorial for that part – never done it from scratch before.

My coding process is usually an all-at-once thing for the HTML and CSS. I try to keep thinking ahead so I don’t double up unnecessary code. No PHP, jQuery or database calls at this stage.

That’s all for now, I’ll update my progress as I go along.

Mac vs PC

The Mac vs PC debate is so tiring.

For this post I’ll use “PC” to mean “Windows”, as that is what most people see it as.

What is the purpose to this post? You may as well ask what the purpose of any Mac vs PC post is. I hope that this post might tame a few fanboys and tone down a few haters.

Everyone has their reasons for using the OS they use. It may be that they’ve always used what they currently use. Maybe they owned a PC as a kid, but started buying Macs recently, or vice versa. Some can’t rest easy because there are people in the world who use a different OS than themselves. And why does this bother them? The same reason that it bothers Christians that there are Atheists, that it bothers Chrome/Firefox users that there are IE users. I’d liken the situation to dining with someone and ordering soup, and then asking why they are ordering the steak.

Why must one OS be better than the other? They are both just tools, used for some purpose; sometimes the same purpose, other times a different purpose. When used for design, a Mac doesn’t produce better artwork or graphics than a PC; it’s the person using it who really produced the work. I have heard many a time of teenagers who usually sketch wanting Photoshop because it will make them draw better, and they genuinely believe this. Once again, Photoshop is just a tool, just as the computer you use is a tool. If you suck at drawing traditionally, Photoshop or Painter won’t magically make you better. Using a Mac won’t suddenly make you better at design; using a PC won’t automatically make you a programmer or a great gamer.

It’s at this point that I will tell you which OS I prefer. I have used a PC all my life. That’s probably one of the reasons I use it. One day I had to work as a graphic designer for a company, and they had a Mac with OSX (forgive me, no idea really what the other OS’s are called). Suddenly having to switch all my Photoshop hotkeys from “ctrl+z” to “cmd+z” was a little frustrating, but I got there. Having to take my own mouse to work because it had a right mouse button was annoying, but I got over it. Having left that job with a better understanding of Macs, I can make a relatively sound decision on which OS I choose. I went straight back to the PC.

Now, this isn’t an argument as to which is better, this is just demonstrating that even having tried a Mac I didn’t magically convert. I stuck to what I prefer. The same could be said for a Mac user who tries a PC for a while. Either they switch, or they don’t. Everyone should choose their OS based on what they prefer, and not fall victim to public perception of what is better. Because it really doesn’t matter. I found I was more productive on a PC; some find themselves more productive on a Mac. Why should anyone care who uses what?

Just like I don’t care about the Christians vs Atheists debate, I don’t care about the Mac vs PC debate anymore. Let the illogical be, let the fanboys be, and leave the arguments to a bit of trolling and perhaps a bit of sound reason here and there.

New Design Portfolio Soon

About time for an upgrade.

My current web design portfolio is in desperate need of an upgrade; not just design, but backend work too. The current design was something I settled on after a miraculous two mockups. This time it has been harder! Do I go for a modern, sleek look? Something hand-drawn? Something more me?

Sketches and doodles and wireframes and PSD mockups lay abandoned around my desk and my PC for months. Nothing seemed right. But at last I have settled on something. It is mostly influenced by Italian renaissance artists like Botticelli and Michelangelo, although not entirely obvious. Sections of a page will be elegantly framed with baroque-like adornements, while still maintaining flow and keeping away from the boxy look I am so prone to. Modern elements will be subtle, yet noticeable. I received advice recently to not go overboard with one style: bring elements in from contrasting styles. This design isn’t a masterpiece, but it reflects me and my interests, instead of being a facade. Although I can’t show you anything now (I am at work), I’ll release a preview of the banner at some point in the future.

Regarding the backend: I found I am entirely compatible with the PHP framework CodeIgniter, and plan to use it to set up a simple content-management-system. I hope to implement more jQuery and maybe even some Ajax (one of my weaknesses), just to let the user know that the modern elements of web design are not completely being ignored. Oh, and it will have an RSS feed and a blog!

Follow me on Twitter to receive more frequent updates.

Countries as an Associative Array

This took me ages.

I found HTML generators and plain text lists of all the countries, but no arrays. So I had to make my own. I’m making a website using CodeIgniter, which can use an array to create a select/dropdown field. Get CodeIgniter here, because it is incredibly handy.

Anyway, here it is, prepare to scroll!

$countries = array(
'Afghanistan' => 'Afghanistan',
'Albania' => 'Albania',
'Algeria' => 'Algeria',
'Andorra' => 'Andorra',
'Angola' => 'Angola',
'Antigua & Deps' => 'Antigua & Deps',
'Argentina' => 'Argentina',
'Armenia' => 'Armenia',
'Australia' => 'Australia',
'Austria' => 'Austria',
'Azerbaijan' => 'Azerbaijan',
'Bahamas' => 'Bahamas',
'Bahrain' => 'Bahrain',
'Bangladesh' => 'Bangladesh',
'Barbados' => 'Barbados',
'Belarus' => 'Belarus',
'Belgium' => 'Belgium',
'Belize' => 'Belize',
'Benin' => 'Benin',
'Bhutan' => 'Bhutan',
'Bolivia' => 'Bolivia',
'Bosnia Herzegovina' => 'Bosnia Herzegovina',
'Botswana' => 'Botswana',
'Brazil' => 'Brazil',
'Brunei' => 'Brunei',
'Bulgaria' => 'Bulgaria',
'Burkina' => 'Burkina',
'Burundi' => 'Burundi',
'Cambodia' => 'Cambodia',
'Cameroon' => 'Cameroon',
'Canada' => 'Canada',
'Cape Verde' => 'Cape Verde',
'Central African Rep' => 'Central African Rep',
'Chad' => 'Chad',
'Chile' => 'Chile',
'China' => 'China',
'Colombia' => 'Colombia',
'Comoros' => 'Comoros',
'Congo' => 'Congo',
'Costa Rica' => 'Costa Rica',
'Croatia' => 'Croatia',
'Cuba' => 'Cuba',
'Cyprus' => 'Cyprus',
'Czech Republic' => 'Czech Republic',
'Denmark' => 'Denmark',
'Djibouti' => 'Djibouti',
'Dominica' => 'Dominica',
'Dominican Republic' => 'Dominican Republic',
'East Timor' => 'East Timor',
'Ecuador' => 'Ecuador',
'Egypt' => 'Egypt',
'El Salvador' => 'El Salvador',
'Equatorial Guinea' => 'Equatorial Guinea',
'Eritrea' => 'Eritrea',
'Estonia' => 'Estonia',
'Ethiopia' => 'Ethiopia',
'Fiji' => 'Fiji',
'Finland' => 'Finland',
'France' => 'France',
'Gabon' => 'Gabon',
'Gambia' => 'Gambia',
'Georgia' => 'Georgia',
'Germany' => 'Germany',
'Ghana' => 'Ghana',
'Greece' => 'Greece',
'Grenada' => 'Grenada',
'Guatemala' => 'Guatemala',
'Guinea' => 'Guinea',
'Guinea-Bissau' => 'Guinea-Bissau',
'Guyana' => 'Guyana',
'Haiti' => 'Haiti',
'Honduras' => 'Honduras',
'Hungary' => 'Hungary',
'Iceland' => 'Iceland',
'India' => 'India',
'Indonesia' => 'Indonesia',
'Iran' => 'Iran',
'Iraq' => 'Iraq',
'Ireland' => 'Ireland',
'Israel' => 'Israel',
'Italy' => 'Italy',
'Ivory Coast' => 'Ivory Coast',
'Jamaica' => 'Jamaica',
'Japan' => 'Japan',
'Jordan' => 'Jordan',
'Kazakhstan' => 'Kazakhstan',
'Kenya' => 'Kenya',
'Kiribati' => 'Kiribati',
'Korea North' => 'Korea North',
'Korea South' => 'Korea South',
'Kosovo' => 'Kosovo',
'Kuwait' => 'Kuwait',
'Kyrgyzstan' => 'Kyrgyzstan',
'Laos' => 'Laos',
'Latvia' => 'Latvia',
'Lebanon' => 'Lebanon',
'Lesotho' => 'Lesotho',
'Liberia' => 'Liberia',
'Libya' => 'Libya',
'Liechtenstein' => 'Liechtenstein',
'Lithuania' => 'Lithuania',
'Luxembourg' => 'Luxembourg',
'Macedonia' => 'Macedonia',
'Madagascar' => 'Madagascar',
'Malawi' => 'Malawi',
'Malaysia' => 'Malaysia',
'Maldives' => 'Maldives',
'Mali' => 'Mali',
'Malta' => 'Malta',
'Marshall Islands' => 'Marshall Islands',
'Mauritania' => 'Mauritania',
'Mauritius' => 'Mauritius',
'Mexico' => 'Mexico',
'Micronesia' => 'Micronesia',
'Moldova' => 'Moldova',
'Monaco' => 'Monaco',
'Mongolia' => 'Mongolia',
'Montenegro' => 'Montenegro',
'Morocco' => 'Morocco',
'Mozambique' => 'Mozambique',
'Myanmar' => 'Myanmar',
'Namibia' => 'Namibia',
'Nauru' => 'Nauru',
'Nepal' => 'Nepal',
'Netherlands' => 'Netherlands',
'New Zealand' => 'New Zealand',
'Nicaragua' => 'Nicaragua',
'Niger' => 'Niger',
'Nigeria' => 'Nigeria',
'Norway' => 'Norway',
'Oman' => 'Oman',
'Pakistan' => 'Pakistan',
'Palau' => 'Palau',
'Panama' => 'Panama',
'Papua New Guinea' => 'Papua New Guinea',
'Paraguay' => 'Paraguay',
'Peru' => 'Peru',
'Philippines' => 'Philippines',
'Poland' => 'Poland',
'Portugal' => 'Portugal',
'Qatar' => 'Qatar',
'Romania' => 'Romania',
'Russian Federation' => 'Russian Federation',
'Rwanda' => 'Rwanda',
'St Kitts & Nevis' => 'St Kitts & Nevis',
'St Lucia' => 'St Lucia',
'Saint Vincent & the Grenadines' => 'Saint Vincent & the Grenadines',
'Samoa' => 'Samoa',
'San Marino' => 'San Marino',
'Sao Tome & Principe' => 'Sao Tome & Principe',
'Saudi Arabia' => 'Saudi Arabia',
'Senegal' => 'Senegal',
'Serbia' => 'Serbia',
'Seychelles' => 'Seychelles',
'Sierra Leone' => 'Sierra Leone',
'Singapore' => 'Singapore',
'Slovakia' => 'Slovakia',
'Slovenia' => 'Slovenia',
'Solomon Islands' => 'Solomon Islands',
'Somalia' => 'Somalia',
'South Africa' => 'South Africa',
'Spain' => 'Spain',
'Sri Lanka' => 'Sri Lanka',
'Sudan' => 'Sudan',
'Suriname' => 'Suriname',
'Swaziland' => 'Swaziland',
'Sweden' => 'Sweden',
'Switzerland' => 'Switzerland',
'Syria' => 'Syria',
'Taiwan' => 'Taiwan',
'Tajikistan' => 'Tajikistan',
'Tanzania' => 'Tanzania',
'Thailand' => 'Thailand',
'Togo' => 'Togo',
'Tonga' => 'Tonga',
'Trinidad & Tobago' => 'Trinidad & Tobago',
'Tunisia' => 'Tunisia',
'Turkey' => 'Turkey',
'Turkmenistan' => 'Turkmenistan',
'Tuvalu' => 'Tuvalu',
'Uganda' => 'Uganda',
'Ukraine' => 'Ukraine',
'United Arab Emirates' => 'United Arab Emirates',
'United Kingdom' => 'United Kingdom',
'United States' => 'United States',
'Uruguay' => 'Uruguay',
'Uzbekistan' => 'Uzbekistan',
'Vanuatu' => 'Vanuatu',
'Vatican City' => 'Vatican City',
'Venezuela' => 'Venezuela',
'Vietnam' => 'Vietnam',
'Yemen' => 'Yemen',
'Zambia' => 'Zambia',
'Zimbabwe' => 'Zimbabwe'
);

I hope this helps at least one person. :)

Why isn’t Apache starting?

Well, I kind of fixed it.

I am noooo PC expert-magician. So when my xampplite apache server wouldn’t start for NO REASON whatsoever, I was thoroughly bewildered. Looking at solutions online helped somewhat, but I had to use a combonation of all of them to get my server up and running again.

So. I hope this little bit of information will be helpful to those of you who (like me) haven’t the slightest clue about the inner workings of your computer, let alone a portable server.

Basically apache/xampplite’s default port is 80. Sometimes other programs use this as a default (such as skype or antivirus software). If another program is using this port, Apache cannot start. It flickers on, then shuts off.

To find out if another program is using port 80:

  1. Run the command line (win key + r, type in cmd)
  2. Type in: netstat -aon
  3. Look under “Local Address” for something along the lines of:
    • 0.0.0.0:80
    • 127.0.0.1:80
    • 192.168.1:80
  4. Note down its PID
  5. Type in: tasklist
  6. Search for the process using its PID

This will tell you what program is using port 80. Most likely it’ll be something like Skype, which you can either close or change which port it uses.

However, if that program is a system process…

The easiest thing to do (in my opinion) is to change which port Apache is using, say from 80 to 85.

To change Apache’s port…

  1. Open up httpd.conf (usually xampplite/apache/conf)
  2. ctrl+f and search for: 80
  3. Replace it with the number of your choice. For me, 85 has worked fine so far.
  4. In your xampp control panel, run “Setup”
  5. Follow the instructions (will probably just be y, n, y, x)
  6. Start apache!

Now this somehow magically worked for me. If it doesn’t for you….good luck, I guess. But if it did, I hope this saved you some time and frustration.

TO THE COMPUTER LITERATE:
I apologise if I have used the wrong terminology or other such discrepancies.

My Motorcycle

fxr 150

My poor, poor, motorcycle.

I’m so terribly neglectful of my baby. Over the past view months I can blame said neglect on my lack of money, but since I’ve been hired (twice) I have no excuse.

So the other weekend I decided to use my pay to do some well-overdue maintenance.

Just so you know, this is not a post about how great and amazing it is for a woman to be doing mechanical repairs when a man normally would. Really, feminists – do you want to be treated the same, or do you want to be unfairly rewarded for performing a task such as this?

Anyway, mini-rant over.

The weekend after getting paid I bought oil and an oil filter (amazingly, the right kind for my bike) and headed to my boyfriend’s parents’ shed.

The tricky part was getting down the driveway…Driving on gravel is all well and good. Riding on gravel is slightly more dodgy, yet still all well and good. Riding on loose gravel down a steep driveway which has a turn at the end? Not so well and good. Each time I go down this waterfall of grit and rock I swear I’m going to drop my bike, scratch the pretty paint, and go tumbling down the hill whilst being mocked by the various farm animals they have.

After making it safely around the corner, I prepare to do the oil change. I must admit, the hardest part of the process is getting the sump plug loose. And this is where a man comes in handy – it’s the same with jars and bottles. I lie on the ground, ensure the ratchet is LOOSENING and not TIGHTENING, brace my sneaker-adorned foot against the rearset and pull with all my might. With a CLUNK, my knuckles smack the lower fairings and the nut moves an inch. Success!

I gleefully unwind the nut and a little too late I remember that behind the sump plug is about a litre of fairly warm and filthy oil. The nut clangs into the drip tray and is quickly followed by a waterfall of opaque, black, liquid. I scramble to grab the nut from the tray and promptly wash my hands.

Now, I wouldn’t exactly call this a mistake, merely an oversight. The mistake I made was removing the drip tray when the oil stopped flowing. This was a mistake because I had yet to replace the filter. The filter cover being yet another orifice for the oil to escape from. I loosened the bolts holding the cover on, and began removing one of them. Oil suddenly spilled on the ground, where recently there was a pan. I quickly replaced it, but the damage was done and the pan was now just spreading the oil around on the concrete.

After replacing the oil and putting everything back together, I splashed some water over the spilt oil. Crisis averted!

It was then I realised the only other thing I could do was tighten, clean, and lube the chain. I guess my mechanical prowess only goes so far.

Wellington and Websites

Long time no post, WordPress

Pretty much due to my laziness and not really much new to report. I will eventually get around to completing that pseudo-tutorial, I promise!

Anyway, this weekend just past I visited Wellington on a road trip with three of my flatmates. This was no normal road trip, as we were in a Toyota Starlet (blurple coloured) and we were picking up a running, fully assembled motorcycle.

Now, a road trip like this isn’t exactly a new experience. Twice so far we have road-tripped to Wellington (once in a Starlet, once in an Accord). Many a time motorcycles have been retrieved from all over the country. This time however, we decided to ditch the idea of taking a trailer or riding the bike back; this time we decided to fit the bike in the boot.

Impossible, you say? Hardly!

starlet

After disassembling all but the motor and frame, the bike fits with room to spare.

Naturally on the way back home we had to take a trip up to the ski field on Mt Ruapehu. Before the twisty road to the parking lot, a sign glares at us: “CHAINS OR 4WD FROM THIS POINT ONLY”.

“Pah!” We exclaim, “The Starlet will surely conquer this icy slope.”

And conquer the slope we did.

ruapehu

The victoriously purple car.

Altogether a thoroughly epic trip. I encourage everyone to embark on similarly ambitious adventures!

And on to the subject of websites…

Recently at university we started PHP and MySQL, and I am having a scary amount of fun considering that it is coding.

But this means I feel I can start seriously working on my portfolio website. The basic design is finished, and I’ll show you some sneak previews soon!

Follow

Get every new post delivered to your Inbox.