Saturday, 22 February 2014

Released an Android game

Download the game here: http://itch.io/jam/flappyjam/rate/2989

After seeing all the Flappy Clones being published on the Play store I thought it would be fun to attempt a similar game, a few days after I started the #FlappyJam started so I had a deadline!


I quickly got the basic mechanics up and running, a score, randomly placed blockers and a character that moved up and down. Not totally convinced with the movement I put a trail in place which I thought looked neat and it made it into the final game.

To make this game stand apart from Flappy Bird I decided to add levels, each time you play your score adds to a total percentage and upon reaching that the next level is unlocked.


Then just to add another dimension to the game I added a bank, character selection and hearts (HP). All of your points go into your bank total, hearts allow you to get hit in game and the new characters get smaller so its easier to avoid the blockers.


Working on a smaller game has been a lot of fun, the level design was quite rewarding, the way in which its coded means you can just drop in a new folder with the correct graphics; change one variable number_of_levels and its instantly in game.

I will try to add a more detailed write up on actual code soon, please check out the game at:





Sunday, 19 January 2014

New menu system

Have been working on a menu for the game, created a new button class and a generator so that adding lists of buttons is simple.

Will need to work on the settings (sounds, music, key bindings) screen and also have a continue/load feature.

Here is what has been done so far:


Thursday, 9 January 2014

LibGDX and Parse.com

To have a break from fish this evening decided to set up a highscore board as a test case for JSON and online storage for Endure.

Full Source Code

Signed up for Parse.com a very neat data-store for mobiles and web applications, they provide example projects for JavaScript, Unity, Android and other platforms.

The best thing is the price... free!

Features
  • Requests: 1 million/month
  • Pushes: 1 million/month
  • Burst Limit: 20/second
 Scores Table


 I did try out the Android sample project but without your app being Andriod as expected there was no way to use the .Jar libraries that Parse provide, but they do offer a great Restful method to POST and GET your data.



Custom Parse Class

I wrote a very simple Java class and imported Java's own Net and IO libraries did not take long to get some scores in and out of the service.

LibGDX has its own Net library so I also gave this a go as my code looked messy, have some speed tests to run yet but happy to be able to push and pull data for free and with no real hassle.

I will not go through my code put post the class for you to see, the important lines here are:

httpPost.setHeader("X-Parse-Application-Id", app_id);
httpPost.setHeader("X-Parse-REST-API-Key", app_key);

conn.setRequestProperty("X-Parse-Application-Id", app_id);
conn.setRequestProperty("X-Parse-REST-API-Key", app_key);


While looking how others use Parse with Java I saw a lot of complaints about unauthorized errors, Parse provides many different keys and you have to set and use the right ones. 

Full Source Code

Code adding hard coded score and retrieving all scores


Lots of testing left to do with this and of course will need to ask the user their name (@twitter_tag) when they start the game, will use this for the upcoming fishing competition and keep a track of all the fish caught.

Also will need to use a JSON library to properly generate the string that is post and also parse the results into objects.

Thanks for reading.

Monday, 23 December 2013

Simple Screen Shake

Lots of games add excitement by using screen shake, when your character gets hit or on certain events a little rumble really lets the player know something has occurred. While prototyping some features of Endure I revisited some old code to add a small rumble when the fishing line breaks:

Small Screen Shake


Large Screen Shake (Over the top)



Code (Simple Rumble Class)

Pastie Source Code

 
public class Rumble {

  public float time;
  Random random;
  float x, y;
  float current_time;
  float power;
  float current_power;

  public Rumble(){
    time = 0;
    current_time = 0;
    power = 0;
    current_power = 0;
  }
  
  // Call this function with the force of the shake 
  // and how long it should last      
  public void rumble(float power, float time) {
    random = new Random();
    this.power = power;
    this.time = time;
    this.current_time = 0;
  }
        
  public void tick(float delta, GameController gc, Hero hero){
      // GameController contains the camera
      // Hero is the character centre screen
    
    if(current_time <= time) {
      current_power = power * ((time - current_time) / time);
      // generate random new x and y values taking into account
      // how much force was passed in
      x = (random.nextFloat() - 0.5f) * 2 * current_power;
      y = (random.nextFloat() - 0.5f) * 2 * current_power;
      
      // Set the camera to this new x/y position           
      gc.camera.translate(-x, -y);
      current_time += delta;
    } else {
      // When the shaking is over move the camera back to the hero position
      gc.camera.position.x = hero.x;
      gc.camera.position.y = hero.y;
    }
  }      
}

This is all the code to achieve a basic screen shake. The timer for the affect works its way down to zero then stops. For large shakes once the rumble is over it will snap back to the character and look very jumpy but this is just a prototype.

To use the class create a new instance of it then conditionally produce a new RUMBLE! Below you see on the line snapping a small shake takes place by changing the power and time parameters, then the main render loop just needs to call the tick function:


public Rumble  rumble;
this.rumble = new Rumble();

if (line.tension > line.max_tension){ // LINE SNAP
  gc.rumble.rumble(.2f, .1f); 
  state = STATE.IDLE;
}

if (gameController.rumble.time > 0){
  gameController.rumble.tick(delta, gameController, hero);
}
So there you go a nice feature to add to any game that could do with some atmosphere or excitement, could be progressed much further and also be used in loads of ways, great for explosions, thunder storms etc. Thanks for reading !_!

Friday, 13 December 2013

Endure gets a new Tile Set

The old tile set had over 20 tiles and updating it was a nightmare. It was time to change the tiles to a much neater and simpler design.

If we are ever going to hire a designer/artist to change the assets for this project then the fewer key elements the better.

So here is a quick look at the new look map:

The number of shadows required is much less than the tiles needed for the old top down view. This new simple design will allow the addition of varied height of blocks for building and jumping etc.

Example of old tile set.



Sunday, 8 December 2013

Newest Feature Boats

Newest feature added into the game is boats, used to travel quicker in water. Still need some visual affects added but the basics work ok.



Tuesday, 26 November 2013

Pixel Brushes for PhotoShop

10 Top Free Pixel Brush Sets (View All)

Want to do some pixel drawing? Fed up of painting on pixel at a time and getting the angles wrong as you are a newbie like myself then check out these neat brush sets to help you along:

Here are 3 that I added to PhotoShop, click click ...