Saturday, September 7, 2013

GameMaker: Day 7 - Climactic Conclusion of this Changing Climate

TL;DR

I didn't get EVERYTHING finished in my clone, but I did add a feature or 2, and the game looks better! I'm going to stick with it for a while, because it WILL make me faster at game development and prototyping.

What I Did Today

Holy cow, this week has gone by fast! It feels like I just started watching videos on GameMaker Studio. But it's been a whole week, and I've gotten a pretty good impression on what it's all about.

Today was my wrap-up for my week-long GameMaker adventure, and the second day I worked on my GM remake of Samsara, my most recent Ludum Dare entry. Despite my best efforts, I didn't get as much time to work with GM today as I wanted, due to being enrolled at a hacker-school currently, and having projects to finish. (Sorry!)

But I WAS able to make a complete-ish game! My remake has most of the features of the full game, but I'm missing 2 crucial things due to my time constraints. The first is music, I just ran out of time to get it put in. The second thing is the copied 'clone' sidekick. While getting everything put together, I didn't have enough time to fully tackle the "not-having-real-arrays" problem, so I pulled the unfinished code out, as to not confuse people with arbitrary code. This is the first thing I need to investigate now that I'm not on a schedule for learning as much as possible.

But you need to put this in perspective. I only spent 4 hours working on this today. Couple this with yesterdays 2 and a half hours, and I only spent 6.5 (ish!) hours on this projects. That's multiple hours less than I spent coding during the first day of the Ludum Dare 48 hour event. This is why I looked into GameMaker. It's quite the program, and I can definitely recommend it to anyone getting into game development, or wanting to be more productive doing so.

This project was a great warm-up to get into GameMaker. You can move with W, A, S, & D, and press the Spacebar to shoot. The enemies randomly spawn, move at a random angle, and shoot at the player at a certain interval. Enemies take you hits, you take 3, and you lose if you hit an enemy.

Play it, look at the code, and enjoy it!

Here are some screenshots


Time spent coding today was about 4 hours, so the entire project was roughly 6.5 - 7 hours.

Source Code

The source code/GM Project file is zipped and available HERE, from my website.

Conclusion

I actually like GameMaker. It has its problems, for sure, but after getting through a few things, it has the ability to really save you time, and make you extremely more productive. Everyone should give it a try, from people who don't know how to program, and will be using the drag-and-drop interface, to people who have programmed or made a game before, and just want something to help with the boring/tedious parts.

Suffice it to say, I'm a fan of GameMaker. They also seem to have a great community too!

Friday, September 6, 2013

GameMaker: Day 6 - Deja Vu

TL;DR

Started re-making a game (Samsara) that I recently made for Ludum Dare, but in GameMaker, in 2 days! Cut out a HUGE chunk of dev time already, can't wait to see the total savings.

What I Did Today

Today was day 1 out of 2 where I will be re-making my HTML5 game Samsara, my latest Ludum Dare entry, with GameMaker. There's not much more to say on that, I've been messing with GM for 5 days, and now it's time to see what I can do.

I'm already seeing great leaps in productivity. i started out by making an empty room, adding the player sprite, and setting up his movement. Everything was super streamlined. I remember getting everything setup with my original entry being such a hassle. 

After that, I changed the snow particle emitter from an earlier example to go from right to left, removed the wobble, and used circles (disks) instead of the snow texture. This created the scrolling star background, but the stars are completely random in size and speed, unlike a static image that scrolls. It gives the game a ton of depth, and really makes the look. Later I made the particle emitter persistent, so it stays between room changes, and placed it on the title menu, so the background never stops or resets from the title screen to being in-game.Its the little things like this that people won't always obviously notice, but would definitely miss if it wasn't there. Anywhere you can add subtle things like that, do it.

Enemies are extremely stupid AI-wise right now, there are 3 that were manually placed just off the screen, and all they do is fly right and shoot constantly, but they'll be a tad smarter by tomorrow night. I also want to make an enemy-spawning object tomorrow, so that way they keep showing up until the user loses/dies.

Added in shooting next, all I had to do was throw a direction of either 0 degrees (right), or 180 degrees (left), give them some speed, and I could create them to my hearts content. I made it so they automatically remove themselves on 2 events, either going outside the bounds of the room, or colliding with a person of the other faction. When each ship collides with a bullet of the other factions, they subtract 1 health from themselves, and the enemies can take 2 hits, while you can take 3. 

Then I threw the title screen in, made an object with no sprite to draw all the title graphics (with custom fonts!), and another object with no sprite to wait for keyboard input to move to the next screen. 

From here all I added the character's ability to draw his UI, which for now is just his health counter, and I was done for the day. I clocked in at just over 2 hours. That's right 2 hours, and I'm just over halfway done with remaking a game that originally took me 48 hours to make. 

Holy. Montana.

W, A, S, D, to move, and space to shoot!

Here are some screenshots



Total coding time was around 2 - 2.5 hours.

Source Code

The source code/GM Project file is zipped and available HERE, from my website.

Conclusion

I'm floored. I've cut roughly 7-8 hours off this development cycle already. I did more today, in 2 hours, than I did during the first day of the LD competition, in about 10 hours. THAT is progress. It should be noted that you can't count all of the 7-8 hours I've saved, as I already have all of the game designed, I just have to code it. So maybe 6-ish hours of savings. Still incredible!

I saved the single hardest feature, the 'clone' ship, for last. The reasoning is that I relied heavily on custom objects and arrays in the JavaScript implementation. This is one area where I realize some of the disdain for GameMaker Language, it does data structures differently than every other programming language I've seen. But I'll power through tomorrow, and have an awesome product at the end to boot!

See you guys tomorrow, for the epic conclusion!

Thursday, September 5, 2013

GameMaker: Day 5 - Persistent Persistence!

TL;DR

GM has awesome features, but it's arrays aren't exactly fun normal. Neat project today. Tomorrow I start my 2 day re-build of Samsara!

What I Did Today

I've wrapped up Shaun Spalding's Youtube video series on GameMaker Studio today.  Pretty informative. He touched on some topics today that I wasn't sure he would. One such topic was basic error/bug fixing and tracking. This is an amazingly useful skill for anyone doing anything related to software development.

There were quite a few topics covered today specifically about GM Studio. The first I want to talk about is changing rooms. Seems like something simple, but it was something I hadn't done just yet. Gm has two ways of changing rooms, by either specifying the name of the room you want to load, or by loading the "next" room. GM decides that the next room is going to be the one below it in the Rooms folder on the Resources tab/explorer which is on the left of your GM Studio window. This allows you to go between menu screens, switch to a game screen, and go between different rooms/screens in the game (think Zelda on the Super Nintendo, how when you walk to the right off the screen, you appear on the left side on a new map!). This brings up the next topic, persistence.

Persistence is the ability for an object to stay 

Then I started seeing where some of the limits to GM are.

Arrays. Arrays suck in GM Studio. There's no way to sugar coat it. The arrays themselves don't know how long they are, or there isn't a way for them to find out. There is supposedly a function you can pass an array to which will return it's length, but when I used code from Google'ed examples, hell even the documentation example, it would error and say that it wasn't a method. ( EDIT::9/5/2013::This is not true, just update GM Studio to 1.2 and the documentation example stops throwing errors) This can be a huge turn-off to many people with a programming background already, because we love arrays. They do one thing, and do it well, at least they do normally.

A solution to this problem that kept popping up online was to use GameMakers build it data structures. Let me preface this next part with this, "Data Structures solve the array problem posed above". Ok, now that that's cleared up, I'm not really fond of I hate data structures. Why? They're a memory leak just waiting to happen. For those of you unaware of what a memory leak is, let me explain. With most things in memory, when you're done with them or cannot see/access them anymore, part of your program called the garbage collector comes around periodically and collects these things in memory (variables, images, objects, ect) and destroys them to free up that space. Sounds great, no? Well with data structures, if you don't explicitly say to GameMaker Destroy data structure 'X' when you're done using the data structure, it stays in memory, FOREVER until your program ends. It doesn't sound too bad at first, but it's a real problem. It's not just when you're done using it, it's anytime your program will stop seeing it, so anytime you destroy an object with a data structure, or switch rooms, ect, you have to make sure to destroy that data structure. If you don't, even though specific version of your room is gone forever, that data structure lives on in your memory. Do this enough, and with enough different data structures, and you could literally fill up your computers memory (though you would have probably stopped playing by them, it can still slow you game down drastically).

"But Nick, why can't you just remember to destroy them?"

Oh, I can, that's not that hard. But it's part of the reason I'm trying GM Studio, is to get away from all the pesky gotchas and tedious code of programming everything by hand. I'm probably just overreacting because of the array thing, but it's still a valid concern.

On a positive note, you can make extensions/plugins for GameMaker, so I think I'll look into making an FULL array extension!

Today's project isn't truly a game, but it looks like one! It starts with a title screen, which you press space to load another room! This puts the penguin in a blue room, with some snow particles. You can move with W, A, S, D, and the other thing you'll notice is the pads marked "WARP". They allow the penguin to go to the other room (red/blue). What's cool is you have penguin and snow particles in each, but technically they're the same objects, they're just persistent, so they carry over to every screen, until I change that.

Here are some screenshots

 





Time coding was about 15-20 minutes.

Source Code

The source code/GM Project file is zipped and available HERE, from my website.

Conclusion

Despite the array fiasco, GM is still pretty awesome. What I made today took about 15-20 minutes, and would easily have taken me an hour-ish or more to do by hand. Besides the array deal I don't have much to complain about today.

On another note, tomorrow is day 6, so I'll start trying to rebuild Samsara! I'll be rebuilding the entire game in 2 days, so it will be just like the Ludum Dare where I made it, except I expect to get more done, with less time to work on it.

EDIT:: 9/5/2013
It has come to my attention that updating to GM Studio 1.2 solves the problem of the method shown by the documentation throwing an error. So it's not that bad anymore. Still gonna try to add a full array, because passing an array to a method to get it's length feels dirty. :/

Wednesday, September 4, 2013

GameMaker: Day 4 - Room with a View

TL;DR

Let is snow, let it snow, let it snow!~ Snowing particles, that is. Also, have you SEEN this view? It's quite moving. (Bad puns ahoy!)

Oh, and double jump. Almost forgot that one.

What I Did Today

I watched a couple more of Shaun Spalding's Youtube videos today. While they are very instructional, he's starting to focus and show how he uses the built in Contents/Help menu (F1) to find explanations and documentation from within GameMaker on all things GM and GML. I've been using it sparingly for a day or so, but spent some time exploring it simultaneously while watching today's videos.

If you haven't checked out the Contents/Help documentation yet by hitting F1 (or haven't checked out GM yet), I'm telling you that you are required to right meow now.

No arguing, this is important.

Learning the basic names of sections and how to navigate the built in documentation will make you a better developer in the long run than any trick you can learn in a video. Yes, videos and tutorials can be EXTREMELY helpful when starting from nothing, but once you have a decent grasp on the basics you need to learn to stand on your own. Knowing how to look up things puts you one step closer to solving your own problems with Google. Yes, Google is great, but one day you're going to run into some bug you can't solve or fix, or some feature you want to implement that NO-ONE has, and there won't be a single tutorial online on how to do that. These tutorials get my super-two-thumbs-up-of-quite-a-lot-of-approval-indeed because they don't just show you haw to do 'x'. They DO show you how to do 'x', but also tell you why you're doing it this way, and show you how to look up helpful things related to it in the process. Flippin' awesome.

Today's project is an expansion of yesterdays, so it's a platformer. The first thing you'll notice is the snow. It's a particle system/emitter that randomizes the size/speed/wobble/lifetime of the snow particles and creates them. After that you'll move around and notice that I implemented a camera system. Literally 0 lines of code, just filled out some fields. Literally. The only code I wrote related to the camera/view is in setting the positions for the UI text. Also, we learned about the depth of things inside the room (level), and how this affects the order in which things are drawn (snow in the back, the level & penguin, then the text. Then we streamlined some of the code for collisions and jumping, and added double jump! (And correct ceiling collision) There are still a couple logic errors where you get hung up on corners when you approach them a exactly the right angle, but For something I threw together in less than an hour I'm pretty darn happy about it. I've written (and then had to test and RE-write) collision code before, and believe me, it sucks. And takes forever. And sucks. Just be happy that GM lets you get something up FAST, and then later you can smooth out the rough edges.

Here are some screenshots



Time coding was about 20 minutes.

Source Code

The source code/GM Project file is zipped and available HERE, from my website.

Conclusion

I'm getting excited about GameMaker. It feels weird, even doing things I would find boring coding completely 100% by hand before (particle systems, collision, ect) are a breeze in GM with GML, and I get them done in LITERALLY a fraction of the time. I'm trying to keep my cool when using GM, but I'm starting to feel like a kid learning to program again! Everything has been fun with GM.

I wonder if there are any arcades close to me in San Fran?

Tuesday, September 3, 2013

GameMaker: Day 3 - Quite the platform.

TL;DR

Platformers. PLATFORMERS. PLATFORMERS!!!1!! METROIDVANIA JUMP-N-MOVE PHYSICS TODAY! Not bad progress for 30 minutes of coding.

What I Did Today

Today was one of my shorter days, we're starting our big final projects at App Academy(the hacker school I'm at), so my time/motivation was all there today. BUT, that doesn't mean I forgot about my pledge to give GM a week of my time.

I started off the day watching the 10th episode from Shaun Spalding's Youtube videos and man, they're getting a lot longer. No extra GM content that I won't need, as he's started showing (almost) purely GML ways of doing things. He also went over some programming concepts, and while I already understood how a loop worked, seeing some of the intricacies of how GML handles them was nice.

The episode I watched today ended at just over 40 minutes, though I did pause once or twice to finish typing out some code. With typing while watching/listening (2 monitors, woo!) I would say I finished the video in just over 50 minutes. I enjoyed the video, and some platformer concepts were introduced and explained also.

Neat.

After the video I did some experimenting, didn't like the results, and put my code back to using a fixed step. I'm too tired to work out the exacts of gravity with delta_time, sue me. Just over an hour spent watching videos/coding, and I have basic platformer collision and movement?

Awesome.

In today's project you can move left and right with W and D, jump with Space, and there's even gravity! Have a blast, and look at the code. Today's code is pretty much Shaun's tutorial code, I'm not focused too much on platformer mechanics at the moment, so I really couldn't change much.

Except to use delta_time, but I'm too tired for that nonsense. No reason to do it if I have soemthing working today! 

Here are some screenshots


Time coding was MAYBE 30 minute, tops. Did so while watching the video and a tad afterwards.

Source Code

The source code/GM Project file is zipped and available HERE, from my website.

Conclusion

GM is turning out to be crazy. I spent less than 30 minutes coding (including experiment time!), and STILL had collision detection and jumping working, though they aren't the most elegant solution. I'm scared to say I'm amazed with GM. I'll keep looking for big shortcomings, and praying I don't find them!

Monday, September 2, 2013

GameMaker: Day 2 - Whats up with that Penguin?

TL;DR

Shaun Spalding has good GM videos. Today's project lets you shoot lasers out of a penguins rump... IN SPACE!

What I Did Today

Today I continued my day old tradition of watching video tutorials on GameMaker Studio. With me having already watched all of Wizirdi's Youtube videos on GM Studio yesterday, I needed something else. Luckily, after wading through some horrible videos, terrible audio quality, and lackluster content, I landed at Shaun Spalding's Youtube videos. VERY good videos.

While I enjoyed the humor from Wizardi's videos, it really didn't serve a purpose, so I'm not disappointed that Shaun doesn't employ the same tactic. However, Shaun does have content of a similar level of quality to Wizardi. Shaun actually has more GM Studio videos (19, compared to 11, though Wizardi has a BAJILLION on GM videos not specifically tied to the new Studio version, like a series dedicated to designing a full game in game maker, and 42 videos on GameMaker Language), and they're a tad longer, but I think I know why.

Shaun explains all of his examples first using the drag-n-drop method (ewwwwwww) and then with the supa-awesome-o GML version. I got through 9 of the 19 videos today, and must say, they're great. After the first video or 2 the way he starts explaining things becomes a little more high-level, showing you what you're doing, and why you need to do it, instead of just telling you to write code, or drag blocks over. This is exactly what a tutorial needs, so that way when the video is over you actually understand the underlying concepts.

I'm pretty pumped to finish Shaun's videos, he's going over platformers next, and I have no clue how to most efficiently do stage collision.

Today's project is a shmup (SHoot-eM-UP), because I'm gearing my learning towards the Samsara remake I hope to have finished after this week with GM. It's looking like I'm going to blow that target out of the water.

With today's project you can move you penguin with W, A, S, D like normal, BUT you can also use the arrow keys to rotate the penguin! This plays into the next thing I added,  bullets! You have two ways of shooting today, the spacebar will let you shoot forward like you would expect, but pressing or holding the ENTER key does something awesome! Instead of shooting in a predefined direction, the bullets shot from pressing enter shoot out at an angle relative to the penguin's rotation.... out of his rump.

Why do the laser bullets shoot out of the penguins rump? Why is the penguin in space?

Because why the hell not? (Also because the "space" is a scrolling, tiling, infinite background! Something else I wanted to do.)

I also got text displaying in a different color, wheeeeeeeeee!

Here are some screenshots

Total time coding was probably less than an hour. I was sporadically coding while watching the videos and a tad afterwards.

Source Code

The source code/GM Project file is zipped and available HERE, from my website.

Conclusion

I'm really enjoying GM, but I'm not getting my hopes up yet. I'm seeing a HUGE dropoff in time that I have to spend coding, but I've only worked on 1 type of game so far. With platformers in tomorrows videos, we'll see how it goes!

Sunday, September 1, 2013

GameMaker: Day 1 - Why the hell am I doing this?

TL;DR

I'm trying out GameMaker Studio for a week, to see if I can be more efficient at creating games with it. By the end of the week I want to have re-made my LD27 entry, with MORE features.

Preface

What?! Nick wants to use GameMaker? Doesn't he know how to program? Is he crazy?

Yes, yes, and yes.

Despite the fact that I know multiple programming languages, I've decided to try using a game engine, specifically GameMaker Studio, for future game prototypes and projects.

Reasoning/Backstory

I've been (kinda) programming for over a decade, doing it seriously for about 5-6 years. I've been seriously making games (as a hobby) for about 2-3 years. It's something I've always done in my spare time.

Recently though, I've been losing more and more of my free time normally for gamedev, due to my life actually getting together, and being accepted to a hackerschool/developer bootcamp (App Academy, if anyone is wondering. Go check it out, it's awesome!). Because of this, during the Ludum Dare 27 game competition, I had a realization near the end.

I didn't get a LOT of the polish features into the game. There isn't even a score. The enemy path finding is non-existent. The enemies can only shoot straight. There's no story or end. While I WAS able to get the "reincarnated" clone to follow your actions and shots, with a 10 second lag (which is AWESOME, if I say so.) , I just couldn't get anything else done ( By the way, my entry is Samsara, play it for 30 seconds? ).

I decided that even though I consider myself a damn fine programmer (no expert, yet!), and I know multiple languages, I'm just not efficient at creating games with my current flow. This is a problem. I don't have globs of time just lying around for me to piddle away. I need every second to matter. Because of this I decided that I would give game making engines another try.


Why GameMaker

 This isn't my first foray into using game creation engines. I've messed with Unity, not extensively, but enough to realize that it was still to cumbersome for simple game dev. A lot of the engines like Game Salad were too focused on non-programmers. I was looking for a middle-man between taking some of the boilerplate work off of me, but still giving me a lot of control over whats going on. Being able to script almost everything I want is a MUST. It came down to 2,

Construct 2, and GameMaker Studio

After some deliberation, I decided to go with GameMaker. After watching lots of videos on both, and doing tons of reading, GameMaker appealed to me more. I'm NOT saying Construct is a bad choice. I'm just saying that it doesn't appeal to me as much as GM does. Both platforms can push to multiple other platforms (including mobile!), but it seems like GameMaker has less problems pushing to other platforms, but don't let me mislead you, GM DOES have bugs. No program is perfect. But I was also swayed by seeing the breadth of products that have been made with GameMaker ( I had no clue Hotline Miami was made in GameMaker! ).

GameMaker it is!

Whats Going to Happen

I've decided to see what I can get done and learn with GameMaker in a week. That's it. I've looked, and I can give at LEAST 1 hour a day to GameMaker this next week, and possibly up to 3 hours on 1 or 2 days. By the end of the week, I want to have a re-made, and more complete version, of Samsara. If I can learn enough about GameMaker and GML(GameMaker scripting Language) to create 

What I Did Today

I started today by downloading GM Studio, and picking a tutorial to get up and running. I ended up at Wizirdi's Youtube series. Not bad at all. Some of it felt too slow, but I attribute that to the fact that I already know how to program. Even with that, his videos are short and concise, I definitely recommend checking his videos out if you're looking to get into GameMaker.

I spent somewhere right around 2 hours watching his videos. I didn't do the exact code he did, and I experimented some, pausing the video to brush off my Google-fu. I did pay attention to what he was saying and typing, but I was changing it to what I was doing, which was just trying to get many different ideas incorporated into one "game".

I ended up with a neat little keep-away game. It's nowhere close to being anything substantial,  but it shows off what 2 hours of GM videos and tinkering can teach you.

You basically move the penguin around with W, A, S, and D. The sprite is constrained to the dimensions of the window. By pressing the space bar the game creates enemies that move towards you, and you can destroy them by left clicking them.

I also learned about drawing text, and concatenating strings(text) with variables(values in the computers memory for things I need it to remember). Your penguin has health, and it is depleted by being touched by one of the enemy angry-faces. If your health hits 0, the user is prompted about the game being over, and it restarts!

Here are some screenshots



Source Code

The source code/GM Project file is zipped and available HERE, from my website.

Conclusion

For spending 2 hours with GM, I feel like I learned a HELL of a lot. I'm not messing with any of the drag-n-drop scripting things, I'm doing all events with code. Which is nice because GML seems to be the love child of C++/Ruby/JavaScript, all languages that I know, and the last 2 are languages I know pretty darn well.

Lets see how far this goes guys, I'm hoping it pans out. If not, I've only wasted 7-14 hours.

Also, check out the GameMaker sub-reddit!

Friday, April 19, 2013

Raspberry Pi Basics: Setting Up the SD card


So BAM, you're super pumped about getting a Raspberry Pi (from here on I'm going to refer to it as a RPi), but you don't know where to start or what to do to set it up.

That's where I come in!

Things you'll need

There's some things you'll need before we start,

  • A Raspberry Pi Computer (RPi)
  • A standard size SD card (no cheap knockoff brands, buy a quality one!)
  • A computer that can read /write to SD cards (this guide uses a Windows PC)
  • A computer with internet access (if you have dial-up, UPGRADE! You'll thank me.)

Clearing the SD card


Lets get that SD card ready
Since the RPi doesn't require you to have a harddrive, they gave you a SD card slot on the bottom of the device. The SD card is where the RPi gets the OS (Operating System) that it will run.

Download & Install Easeus

The first piece of software we need to download is the Easeus Partition Master, CLICK HERE TO DOWNLOAD

This is the FREE home edition, and will be more than capable of what we need it to do.

Partitions, and why we need Easeus

Going off on a tangent to explain why we need this. With windows you normally just have your entire harddrive available to put data on. On other OS' they like to split up the data, for a multitude of reasons. They do this with partitions, which are basically just sections of your storage device that are meant to keep certain data seperate. Windows can ONLY SEE THE FIRST PARTITION. So since we are setting this SD card up to run a distro of Linux, we need to be able to see and work with all the partitions on the SD card.

Back to Business

So go ahead and install the Easeus Partition Master, insert your SD card into the computer, and run Easeus.

When you see this screen

Click on the sentence "Go to main screen". This will load up the main screen of the program.

Deleting/Resizing partitions


The program's main window will list all your storage devices, some information on them, and the partitions that they currently have. You have to find your SD card now, just look for one that has a size close to what the SD card is labeled as. Mine is Disk 4, drive H. If you don't see yours, click the Refresh button on the top left. 

If your SD card has more than 1 row under its "Disk" label, it has multiple partitions.

See, mine has 2

 Start with the last of the partitions on your card (or all of the ones that have asterisks "*" instead of a letter), right click each and click "Delete Partition". (Make sure you have your SD card selected, you could lose a lot/all of data if you did this to your computers main partition!)



It will prompt you if you REALLY want to delete it, click "Yes".

Once you have deleted all but the last partition (the named partition, mine was "H") you will be left with "unallocated" space. This is just space on the storage device that isn't assigned to any partition. Let's fix that! We will extend the named partition to take up all the space by right clicking the partition we have and clicking on "Resize/Move Partition".


Once the popup appears, stretch the sliders to take up the ENTIRE bar, where "Unallocated space before" and "Unallocated space after" are both 0.0, then click "Ok".


IMPORTANT: You must not click "Apply" in the top left of the program to actually apply all of these changes we've been making. If you don't, NOTHING will get changed!


It will prompt you to double check everything, click "Yes" and it will start applying the changes. This can take a while depending on the size and quality of the card, and how fast your computer is. It will send you a popup when it's done, telling you that the operations executed successfully!

Congratulations! We're halfway done with setting up the SD card!

Now to get the Operating System (OS) on that card!

Getting the Operating System on the card

The operating system we're installing isn't like a normal program you install. There's no one click and you're done. With it being a Linux OS, it will have multiple partitions it needs set up, so the developers take a digital screenshot of what a basic setup should look like. All we have to do is write this "image" of the basic OS setup to our storage device (SD card), and we're ready to boot it up!

Getting WinImage

The program we'll be using to write the image to the SD card is called WinImage. CLICK HERE TO DOWNLOAD

On that page, under the 8.5/8.10/8.0 section (this is as of 4/19/13, use the newest NON-beta version), if you have a 64-bit version of Windows, download that file "wima6485.exe". This file is an installer for EASY setup. If you're not sure if you have a 64-bit version of windows or not, download "winima85.exe". It's a 32-bit version which will work on all 32 AND 64 bit versions of windows. (If there is a newer version of winimage available, find the .exe that has in the description to the right either "64-bits" or "32-bits" depending if you KNOW you have 64-bit or not, and make sure at the bottom of its description it says, "This file contains a setup program for easy installations". If there are multiple .exe files that match this, the description should also say what versions of Windows they were made for. That should just about solve it.)

Run the .exe file you jsut downloaded to install WinImage and use all the default settings (unless you know what you're doing).

Now to download the Raspberry Pi's Operating System!

Downloading The RPi's OS

The Raspberry Pi foundations website has a list of operating systems that they know are quality, and made specifically for the RPi. The list (with download links) is available at http://www.raspberrypi.org/downloads

They have a custom OS called "wheezy". It's a RPi version of the popular Linux Debian system. There are actually 2 versions available on the website

  • Raspbian "wheezy"
  • Soft-float Debian "wheezy"
These are the first 2 OS' listed on the page I linked. They are actually EXACTLY the same, except for one tiny detail. The second option (Soft-float Debian "wheezy") uses a slightly slower, soft-float ABI.

Soft float, what the heck is that? 

Soft float is how the computer calculates floats (fancy computer jargon for numbers with decimal parts). With soft float, the computer calculates decimal parts of numbers with software, just like you would with pen and paper to figure out the floats (decimal numbers). It's slightly slower than having hardware to calculate floats. 

Why does this matter? Well, with the soft-float version you're able to install the Java Virtual Machine, which lets you write, compile, and run Java code and programs! This gives you another language you can use/learn on your RPi. Sweet, huh?

Needless to say, in this tutorial I will be installing the Soft-float Debian "wheezy".

You can download the zip folder by clicking on either torrent or direct download, though I would suggest the Torrent as it will usually be MUCH faster (unless you don't know what a Torrent download is, in that case just click direct download).

Once completed, find out ehere you downloaded the Zip, and extract/unzip it. Inside the created folder you will find a file that has a .img at the end of it (if you have that enabled, if not, dont worry). Remember where this is!

Writing the OS image to your SD card

Open your start menu, click the "Win Image(Administrator)" link from you start menu/programs list. If it prompts you, click "Yes" to give it admin access (it's necessary!).



Click on the "Disk" tab on the toolbar of the program window and select the disk that is the SD card. Mine was named H earlier, so I clicked on "use removable disk H". If you're not sure what drive letter it is, open up "My Computer" and see what letter your SD card is using under removable media. 



IMPORTANT: Make SURE you get the right drive letter, if you mess up you can completely wipe your computer!

Click on Disk, then on "restore virtual Hard disk image on physical drive"


When the popup appears, select the Disk that has the same size storage as your card, mine was a 16GB card, so I selected Disk 3.


When you click "OK", it will have you find where you unzipped/extracted the .img file we downloaded earlier. Navigate to that folder/location and select the file. You might need to click the drop down menu on the bottom right and click "all files".


It will prompt you one last time, letting you know that this is the last chance you have to double check what you're doing, so you don't mess up your harddrive. As long as you've check the drive letters, click "OK" and wait for it to complete!


Once it's finished, close WinImage, and remove your SD card from your computer, because it's done! The SD card is ready to be used. 

In the next tutorial we will go over the first time setup of your Raspberry Pi's operating System!

<< Previous: Raspberry Pi Basics: What the heck IS it?

Friday, April 12, 2013

Raspberry Pi Basics: What the heck IS it?

Welcome! It's been a little while since I posted on here. I've been getting things together in my real life, but that's all straightening out, so time for tutorials!

Lets start with the Raspberry Pi!



Wait, did you say pie?!

Uh, no. I said "pi", as in the mathematical constant. The name "Raspberry Pi" is a play on words. But the actual Raspberry Pi is no joke, it's quite the awesome device.

The Raspberry Pi is a tiny credit-card sized computer brought to us by the people at the Raspberry Pi foundation. It offers the ability to have a full fledged computer for less than $40. This little device has a ton of features,

  • Composite video out (yellow circular plug for old tv's)
  • HDMI out (for High Def tv's, also outputs sound through this port)
  • 3.5mm audio out (headphone jack sized)
  • SD card port
  • 2 USB ports (rectangle ports, where you plug in keyboards and external hard drives)
  • Ethernet port (where you plug the cable in for internet)
  • 512MB of RAM (RAM is part of what makes a computer fast)
  • GPIO pins (connectors to external parts, *I'll go into this later*)

On a side note, that's for the $35 Model B of the Raspberry Pi. There is a cheaper model A that only costs $25 but it has a few drawbacks.

  • Only has 1 USB port
  • Only has 256MB of RAM
  • Has NO Ethernet Port

You can get both models of the Raspberry Pi from either RS Components, or Element 14. Depending on your current location on our big blue ball of a planet, I would personally suggest Element 14 if you're not in the UK, and RS Components if you are.

Device Benefits

But just being a small computer isn't the only draw to the Raspberry Pi. It's seriously cheap, so quite a few can be bought for the price of a full sized computer, and it will increase the availability of computers to more needy areas. The people at the Raspberry Pi foundation are also hoping to spread computer literacy and to teach more people and kids to program.

I'm willing to bet most of you didn't know what I was talking about when I said the Raspberry Pi had GPIO pins. Well, GPIO stands for General Purpose Input/Output. These little pins let you connect electronic parts, sensors, and motors! This way you can create programs that take control of or get data from these parts! You can make anything from an automated coffeemaker to Doctor Who props! (Or maybe even turn your stairs into a piano.)

All of the Programming!

This little device has serious potential. You have easy access to MANY languages, including (but not limited to)

  • Python
  • Html5/JS
  • Ruby
  • C/C++
  • Scratch
  • Java - only on certain distributions(versions) of Linux (The operating system the Raspberry Pi runs)

What is this "Linux" you speak of?

Well.. Linux is a operating system. If that doesn't make sense, think about this. You can buy a ton of different  brands of computers (Dell, HP, Asus, etc), but they all come with Windows. Windows is an OS (Operating System) too. If you own a Mac, your OS is called OSX, but all the updates have names like Mountain Lion.

Linux was made by Linus Torvalds. Linux's big push was that it was free and open source(you could literally edit the operating system and re-install it). Because of this many people have customized it a released it as a custom distro(short for distribution, its just a custom version of Linux).

But don't worry We'll be getting into all that in the next tutorial!

Saturday, March 16, 2013

Fire Sprite update!

Quick update!

Added some new functionality to FireSprite.js today! I wanted the ability to be returned a canvas instead of just a FireSprite object. So by calling the createSpriteCanvas("imgName.png") method of your FireSpriteAtlas you are returned a canvas the exact width and height as the originally packed image, with JUST that image on it. Once you have the canvas you can scale, rotate it and all that jazz manually before drawing it to your game canvas.

Neat, huh.

Check out Fire Sprite on GitHub!