Tuesday, 5 February 2013

It's been a while, huh? Almost a year to be exact. I felt bad for not blogging what I've been up to, so I thought I'd mention how to find me. I am on Twitter, @PixelbearGames. You can find my Tumblr via me there. I loved this blog, and it's sad to see it go. :( So many memories in the archives. Thanks for sharing the journey.

Tuesday, 15 May 2012

Replaying

Quick note: There was a disaster with boxSlide, in which I lost all of the files. I was incredibly dismayed by it, but I can't hang onto it forever, I guess.

Anyway, since that, I've been going back to basics and learning new things. I'm going to write about one of the fun things I've been doing recently:

For boxSlide, one of my main advertising points was the ability to watch a replay of the level. Now, you may think that creating a replay of someone's actions could be quite difficult - perhaps because you're thinking it's something to do with saving actual footage of the event. There is a much more logical way around this.
Basically, you store keystroke data. This means that when the player presses a certain key on the keyboard, this data is logged (I use an array to store this data). Here's an example:

-----------------------------------------------------------------------------------

var keyInput:Array = new Array();

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);

function keyPressed(Event:KeyboardEvent):void{
        if(Event.keyCode == 37){
                keyInput.push("left");
                trace(keyInput);  
        }else if(Event.keyCode == 39){
                keyInput.push("right");
                trace(keyInput);   
        } else if(Event.keyCode == 38){
                keyInput.push("up");
                trace(keyInput);   
        } else if(Event.keyCode == 40){
                keyInput.push("down");
                trace(keyInput);   
        }
}

-----------------------------------------------------------------------------------

This code would simply add either "left", "right", "up" or "down" depending on what key is pressed to the array, and then the array is traced (similar to printing in other languages). However, this isn't very effective, as if you hold down any of the keys, the corresponding value is constantly pushed into the array. For instance, if I held down the left array key for an extended amount of time, I'd find the array to look like this:

left,left,left,left,left,left,left,left,left etc.

To counter this, you can add a simple if condition:

-----------------------------------------------------------------------------------

var keyInput:Array = new Array();

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);

function keyPressed(Event:KeyboardEvent):void{
        if(Event.keyCode == 37){
                if(keyInput.length - 1 != "left"){
                        keyInput.push("left");
                        trace(keyInput);
                }  
        }else if(Event.keyCode == 39){
                if(keyInput.length - 1 != "right"){
                        keyInput.push("right");
                        trace(keyInput);
                }  
        } else if(Event.keyCode == 38){
                if(keyInput.length - 1 != "up"){
                        keyInput.push("up");
                        trace(keyInput);
                }  
        } else if(Event.keyCode == 40){
                if(keyInput.length - 1 != "down"){
                        keyInput.push("down");
                        trace(keyInput);
                }  
        }
}

-----------------------------------------------------------------------------------

The new if condition is basically asking if the last value in the array is not the same as the one we're trying to add, then allow it to be added. Also, a quick note: You may be wondering why it's "keyInput.length - 1" as opposed to "keyInput.length". This is because an array starts at 0 instead of 1. However, by having a value in keyInput[0], the array's length is 1. Therefore, we must take one off.
Now, this method is all well and dandy for games such as boxSlide, as timing did not matter. However, in the prototype I've been creating recently, timing WAS important. Therefore, I created a timer, and at every key press, I also logged what time it was done. For instance:

-----------------------------------------------------------------------------------

var keyInput:Array = new Array(),  timeInput:Array = new Array();
var timer:Timer = new Timer(1000);
var time:int = 0;

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
timer.addEventListener(TimerEvent.TIMER, gameTimer);


function gameTimer(e:TimerEvent):void{
        time++;
}
timer.start();

function keyPressed(Event:KeyboardEvent):void{
        if(Event.keyCode == 37){
                if(keyInput.length - 1 != "left"){
                        keyInput.push("left");
                        timeInput.push(time);
                }  
        }else if(Event.keyCode == 39){
                if(keyInput.length - 1 != "right"){
                        keyInput.push("right");
                        timeInput.push(time);
                }  
        } else if(Event.keyCode == 38){
                if(keyInput.length - 1 != "up"){
                        keyInput.push("up");
                        timeInput.push(time);
                }  
        } else if(Event.keyCode == 40){
                if(keyInput.length - 1 != "down"){
                        keyInput.push("down");
                        timeInput.push(time);
                }  
        }
}

-----------------------------------------------------------------------------------

In this part, I created an event timer (although, I could've used a simple setInterval - I dislike using these however, as you can't stop and start them, whereas with an event timer you can), and then every time the counter "ticked", the integer time increased by 1. I then pushed the time's value into the timeInput array every time a key was pressed. Pretty simple stuff.
Now that that is done, you can use this information and translate it into some visual feedback. Here's an example of my prototype in action (bear in mind it has other things added to it like colour transformations):

REPLAY GAME

Instructions: Use the left and right arrow keys to control the box. Avoid the obstacles, and make it to the right side of the game screen. As of now, there's no true objective/point for there being a replay, however, I do have plans for this.

Basically all I wanted to say! I found it rather interesting to make. Feedback would be nice. :)

Monday, 16 April 2012

boxSlide!

Wow, people actually asked for an update. Well, as you can tell by the header, I've been working on a game. I've been primarily doing it with Rojoco. It's a large project, but it's nearing its completion - all we're doing now is packing in more and more content. =)

The main concept of the game is quite simple. Use the arrow keys to slide around on the ice. You can only change direction if you stop moving, i.e. hit an object. Think Pokemon ice puzzles. To beat a level, you have to reach the checkered tile. Sounds simple, but there are lots of different mechanics to increase the difficulty (as seen in the header).

Along with the levels that are still being produced (there will be 40 in total), there's a level editor. This is what we use to produce the levels, and it's incredibly easy to use.

There are lots of other cool things that we're including, since we want this game to be packed with content. Since I don't have much time at the moment, this is just an extremely brief overview of the last few months' efforts. In the next post I'll get some preview images out and be a little more in depth about each mechanic. But for now, you can try and work things out from the header. Thanks!

Saturday, 28 January 2012

Game Update

Well, last time you saw my progress on a map editor. Well, I've been using that editor and creating a bunch of maps with it. Now, these maps would be pretty pointless, unless I had something that used that map data...

Introducing... LOOTURE!

This is the first sighting of my game engine! The engine runs similar to the original Zelda - you can move around the map using the arrow keys. When you reach the edge of a map, you move onto the next map. There's a lot more to it than that, obviously.

I'm going to try and give updates on this thing as a lot of work has already been put into it. I'd like a lot of it to be kept secret for a while, though. =P

GAME UPDATES:

  • Created the game engine (map changing, collision detection etc.)
  • Added a bunch of new sprites (such as the hedge sprites)
  • Added a playable character

Like I said, there's a lot more than that. I just want to keep it secret until a future update. See ya!

Saturday, 14 January 2012

What I've been up to!

Not made a post in a while. Ah well. Recently, I've been rather busy with school, but I've been working on a big project (which I've been steadily progressing with, thanks to a little schedule). I'm going to show off the editor I created for the project, as the project will use lots and lots of map codes to produce one big world:

This is the first thing you see when you start up the editor. It produces a 20x15 tile area (each tile is 20x20 pixels). The default map is just a large grass area. Now, the diagram below shows all of the mechanisms I've implemented into the editor to make it easy for me:


1. This is a small snippet of the level code of the map displayed under the tile selector. The actual level code is 1200 numbers long.

2. This is the page number of the tile selector. I can navigate through the pages by using the left and right arrow keys, or I can scroll through each tile to eventually reach the next page by using the mouse wheel.

3. This is the tile selector displaying page 1 of the tiles. There's 78 tiles per page (plus the 13 tiles on that little bottom bar). To hide the tile selector, I have to move my mouse over the little bottom bar, and to show it, I simply scroll using the mouse wheel.

4. This is the currently selected tile. This helps when I haven't got the tile selector visible. If I move my mouse over it, it moves to the top left hand corner so I can get underneath it.

5. This is the layer number. The layer numbers go from 4-1 (4 being the bottom layer, 1 being the top).

---

Here are a few more screenshots, showing the layers panel and the saving and loading screen:

I right-click to bring up the layers panel. I then scroll through the layers with the mouse wheel.

I hit the escape key to bring up the editor menu. I click either save or load - save allows me to create a new .txt file which then has the level code pasted into it, and load allows me to open up a .txt file that the editor then reads and displays accordingly.

---

That's basically it! Well, I've been creating lots of maps using the editor, but that's all. I also started work on the actual game engine, but I've left that for now; doesn't need doing right this minute. Happy new year!

Saturday, 12 November 2011

OMG! ZOMBIES! 2 released!

I released OMG! ZOMBIES! 2. I'm not even sure if I mention I was making it over here on the blog. It was only a 4 day thing, anyway. The link to the game is in the GAMES section. Happy shooting!


Saturday, 22 October 2011

IT work

Made a presentation program for IT. It was rather enjoyable to do, because it's something completely different to make. I made it so all of the required data is imported - so images as either .PNG or .SWF (in case I want animations), and text from .txt files, then dividing it up using ".text.split(",");".

Although, the .FLA file did corrupt, I have an older version of the file. Plus all of the information is imported anyway. =P

Monday, 17 October 2011

Woops!

Haven't posted here in a while. Here's an update on what's been going on:

Chromobox:

I improved the editor. It's still a little buggy, but this new system makes it SO easy to add blocks. I'm incredibly happy I did it.

Other:

I was ill for 4 days, and in that time I thought I'd go ahead and make OMG! ZOMBIES! 2. And I practically finished it in those few days! However, a bunch of bugs arose, so I had to remove the download link for a while. It's almost fixed now, so I'm cool.

Saturday, 24 September 2011

Just finishing the editor up...

After adding all of the Beta stuff, I realised I should probably rehash something with it, which will make updating the editor a whole lot easier later on.

Right now I have a really cheap system for adding new blocks to the editor which takes ages to update and things, so I'm going to redo it so the game sorts, orders etc automatically. This should be fun...

Thursday, 22 September 2011

Got bored, did some Pixel Art


It's a wallpaper specifically for my computer, btw. I guess you could customise it yourself if you REALLY wanted to.

EDIT: Here's a direct link to the image, as blogger is being a dick: http://img836.imageshack.us/img836/7136/cavewallpaper.png

Tuesday, 6 September 2011

Closed Beta - Editor

I've been having a closed beta for the editor in the game. Quite a few things have cropped up (no glitches, but a lot of improvement ideas). I'm doing the editor beta now as I want the beta to be perfect for when I start making levels for the game.

Here are the things that have come up:

-Add an error message to the loader if something fails to load
-Increase transparency of hidden panels
-Make it so you can't put words in the money box
-Add a "clear all" button
-Add name boxes when items are scrolled over

Some of them I have implemented. Others, not yet. I'm looking forward to the editor being complete, though. =D

Thursday, 25 August 2011

Saving and loading with the editor

I've had one hell of a time updating the editor, most of all with the saving and loading part of it.

Saving was fairly simple. It just exports an array (in a dynamic text box) which you can then copy and paste anywhere. However, the loading wasn't as simple. When I came up to it, I realised that I didn't actually know how to take data from an input text field and turn it into an array. After a quick Google, I decided on using the ".split();" method. Basically, it divides a string (for instance, a sentence) into letters. This was perfect for the loader, as it just split up the inputted data into readable chunks.

However, the next problem was much worse. I realised after discovering some bugs that the ".split();" method turned all of my number values into text values, which meant I couldn't put in a much needed "+1", as it just came out as "31" (that is the number gained from the .split(); method (3) and the +1).

I eventually found a solution by reworking some stuff, but God. Gave me a headache.

Wednesday, 17 August 2011

Character Creation Update!

Been working quite a bit on getting the character creation sorted. You can now choose your character's hat/hair, his facial features, his head colour, his body colour and his leg colour. Here are a few images of it:





The graphics aren't final; they'll be going through some changes. A lot more hats/hair and faces will be added as well. You'll notice the big "SECRET!" area - that's something else that I've been working on, but I'm keeping it secret until a later date. :3

Sunday, 14 August 2011

Holiday, customisation, poster

A lot's been going on since last post! I went on holiday for 2 weeks and didn't tell anyone, which is why there has been a sudden lack of posts.

On the theme of game development, I've been progressing with the character customisation screen. It's working great at the moment - all I have to do now is program the colour pickers in.

I also made a poster yesterday:


Nifty! Just some editing practice based on a friend's comic.

Saturday, 23 July 2011

What I've been doing...

Well, I've sorted out a load of character sprites and whatnot, which are looking pretty good. I've also been developing the character customisation screen, which is one boring task. D:

Saturday, 9 July 2011

Next on the agenda!

Ok, had a little time to think what's up next, so here I go:

Next comes character customisation. I've made quite a few sprites for the characters, but I want a lot more, so there's lots of combinations and uniqueness! Here's a list of things that need doing:

- Create a character customisation screen
- Enable character placement in the editor
- Create lots of sprites for the characters

So there's lots of drawing and programming for this one. Yum.

Menu pretty much done!

The menu is practically done now, minus background images - these will be screenshots from the finished game. =)

I'm not sure what to aim to complete now... I guess getting the player functioning properly?

Monday, 27 June 2011

104th post?!

Damn, I totally missed the 100th blog post!

Ah well, we celebrate now. =D

Update on the menu!


That's how it's looking so far. There is still a background and some other stuff to add to it, however. I just needed a rest. :P

Quick note: the menu is no longer controlled by the mouse - instead you use the arrow keys to scroll through the options. :3

Saturday, 25 June 2011

Riddled with bugs...

There are a few bugs that I'm having to sort out that are rather irritating. Although, they're bugs that appeared when I added new content, so it's not that bad.

Right now I'm taking a break from bug fixes, and I'm working on the main menu design. As of now it doesn't look too nice, so it needs sorting out pronto. What I have now is just a simple place-holder:



I threw this together about a month back now just so when I opened the game it wasn't utterly disgusting. But I can do better now.