PrettyPrint

Sunday, 17 March 2013

The Completed Game.

After finishing the game I decided to have a little write up on how the final product has differed from the original plan. First of all the biggest thing missing from the final product is the ability to be able to pick up collectables to increase the score of the player, this was removed from the game as in the time space that the game was given to get completed I deemed to to time consuming to continue trying to implement not matter how much this feature would have added to the game. Apart from this all other features of the game made it in and are fully functional which I am very pleased with and the group that I decided to work as part of have worked very well together with all of us pulling their weight getting the work that they needed to be contributing in on time. If I were to give any advice to anybody thinking about undertaking a similar project I would definitely make sure that enough time is given to the coding side as trying to learn how to code a fully functioning game, no matter how small and simple it may be, from only a very basic understanding knowledge of a programming language is very time consuming but is also immensely rewarding. Finally a video of the completed project can be seen below.




Creating The Game - 17/03/2013 (Final Post)

This will be the last post that I will posting on the development of Jetson's Journey as the game is now complete and the coding side of the project is done. In this post I will be detailing the creation of the second level and also the changes to the original plan that have been made throughout the creation of the game.

First of all I have finished the creation of the second level for the game. This was a much simpler process that first thought as the code used from the first level directly copied over to this level allowing for 85% of the base code to already be complete, but there are some slight changes in this level that needed to be added. First of all a new BlockMap and Block class needed to be created for this level to use, The code for these is shown below:

BlockMap2 Class


import java.util.ArrayList;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.tiled.TiledMap;
 
public class BlockMap2 {
 public static TiledMap tmaps;
 public static int mapWidth;
 public static int mapHeight;
 private int square[] = {1,1,31,1,31,31,1,31}; //square shaped tile
 public static ArrayList(Object) entitiestwo;
 
 public BlockMap2(String ref) throws SlickException {
  entitiestwo = new ArrayList(Object)();
  tmaps = new TiledMap(ref, "data");
  mapWidth = tmaps.getWidth() * tmaps.getTileWidth();
  mapHeight = tmaps.getHeight() * tmaps.getTileHeight();
 
  for (int x = 0; x < tmaps.getWidth(); x++) {
   for (int y = 0; y < tmaps.getHeight(); y++) {
    int tileID = tmaps.getTileId(x, y, 0);
    if ((tileID == 3) || (tileID == 11)) {
     entitiestwo.add(
                                        new Block2(x * 32, y * 32, square, "square")
                                        );
    }
   }
  }
 }
}

Block2 Class
import org.newdawn.slick.Graphics;
import org.newdawn.slick.geom.Polygon;
 
public class Block2  {
 public Polygon poly;
 public Block2(int x, int y, int test[],String type) {
        poly = new Polygon(new float[]{
    x+test[0], y+test[1],
    x+test[2], y+test[3],
    x+test[4], y+test[5],
    x+test[6], y+test[7],
        });   
 }
 
 public void update(int delta) {
 }
 
 public void draw(Graphics g) {
  g.draw(poly);
 }
}

As you can see the BlockMap2 Class is slightly different from the original as this is using different tile IDs to create the BlockMap as there have been different tiles used within the creation of this level. After this was done The AI in the second level also had to be changed as there are many more AI used in this level. The new AI code is shown below:

Initialising The AI:


 ai1 = enemyLeft;
 ai2 = enemyRight;
 ai3 = enemyLeft;
 ai4 = enemyRight;
 ai5 = enemyLeft;
 ai6 = enemyRight;

 AIPoly1 = new Polygon(new float[]{
   x,y,
   x+32,y,
   x+32,y+32,
   x,y+32
 });

 AIPoly2 = new Polygon(new float[]{
   x,y,
   x+32,y,
   x+32,y+32,
   x,y+32
 });

 AIPoly3 = new Polygon(new float[]{
   x,y,
   x+32,y,
   x+32,y+32,
   x,y+32
 });

 AIPoly4 = new Polygon(new float[]{
   x,y,
   x+32,y,
   x+32,y+32,
   x,y+32
 });

 AIPoly5 = new Polygon(new float[]{
   x,y,
   x+32,y,
   x+32,y+32,
   x,y+32
 });

 AIPoly6 = new Polygon(new float[]{
   x,y,
   x+32,y,
   x+32,y+32,
   x,y+32
 });

Drawing The AI:


  
                g.drawAnimation(ai1, AI1x , AI1y);
  g.drawAnimation(ai2, AI2x , AI2y);
  g.drawAnimation(ai3, AI3x , AI3y);
  g.drawAnimation(ai4, AI4x , AI4y);
  g.drawAnimation(ai5, AI5x , AI5y);
  g.drawAnimation(ai6, AI6x , AI6y);

AI Logic Code:


  
                AIPoly1.setY(AI1y);
  AIPoly2.setY(AI2y);
  AIPoly3.setY(AI3y);
  AIPoly4.setY(AI4y);
  AIPoly5.setY(AI5y);
  AIPoly6.setY(AI6y);

  if(enemyR1){
   AI1x -= floatDelta;
   ai1 = enemyLeft;
   enemyLeft.update(delta);
   AIPoly1.setX(AI1x);
   if(entityAICollisionWith(AIPoly1)){
    enemyR1 = false;
   } 
  } else {
   AI1x += floatDelta;
   ai1 = enemyRight;
   enemyRight.update(delta);
   AIPoly1.setX(AI1x);
   if(entityAICollisionWith(AIPoly1)){
    enemyR1 = true;
   }
  }

  if(enemyR2){
   AI2x += floatDelta;
   ai2 = enemyRight;
   enemyRight.update(delta);
   AIPoly2.setX(AI2x);
   if(entityAICollisionWith(AIPoly2)){
    enemyR2 = false;
   } 
  } else {
   AI2x -= floatDelta;
   ai2 = enemyLeft;
   enemyLeft.update(delta);
   AIPoly2.setX(AI2x);
   if(entityAICollisionWith(AIPoly2)){
    enemyR2 = true;
   }
  }
  
  if(enemyR3){
   AI3x -= floatDelta;
   ai3 = enemyLeft;
   enemyLeft.update(delta);
   AIPoly3.setX(AI3x);
   if(entityAICollisionWith(AIPoly3)){
    enemyR3 = false;
   } 
  } else {
   AI3x += floatDelta;
   ai3 = enemyRight;
   enemyRight.update(delta);
   AIPoly3.setX(AI3x);
   if(entityAICollisionWith(AIPoly3)){
    enemyR3 = true;
   }
  }
  
  if(enemyR4){
   AI4x += floatDelta;
   ai4 = enemyRight;
   enemyRight.update(delta);
   AIPoly4.setX(AI4x);
   if(entityAICollisionWith(AIPoly4)){
    enemyR4 = false;
   } 
  } else {
   AI4x -= floatDelta;
   ai4 = enemyLeft;
   enemyLeft.update(delta);
   AIPoly4.setX(AI4x);
   if(entityAICollisionWith(AIPoly4)){
    enemyR4 = true;
   }
  }
  
  if(enemyR5){
   AI5x -= floatDelta;
   ai5 = enemyLeft;
   enemyLeft.update(delta);
   AIPoly5.setX(AI5x);
   if(entityAICollisionWith(AIPoly5)){
    enemyR5 = false;
   } 
  } else {
   AI5x += floatDelta;
   ai5 = enemyRight;
   enemyRight.update(delta);
   AIPoly5.setX(AI5x);
   if(entityAICollisionWith(AIPoly5)){
    enemyR5 = true;
   }
  }
  
  if(enemyR6){
   AI6x += floatDelta;
   ai6 = enemyRight;
   enemyRight.update(delta);
   AIPoly6.setX(AI6x);
   if(entityAICollisionWith(AIPoly6)){
    enemyR6 = false;
   } 
  } else {
   AI6x -= floatDelta;
   ai6 = enemyLeft;
   enemyLeft.update(delta);
   AIPoly6.setX(AI6x);
   if(entityAICollisionWith(AIPoly6)){
    enemyR6 = true;
   }
  }

  if(playerPoly.intersects(AIPoly1) || playerPoly.intersects(AIPoly2) || 
                   playerPoly.intersects(AIPoly3) || playerPoly.intersects(AIPoly4)|| 
                   playerPoly.intersects(AIPoly5) || playerPoly.intersects(AIPoly6)){
   dead = true;
   Level2.stop();
   death.play();
  }

 }

After this code was completed I also Added an exit to this level allowing the player to complete the level of the game. This was done once again by adding some simple Code and then displayed the End Screen that Stephen had created to the user. The code for this is shown below:

Initialising The Door And End Menu:


door = new Image("data/Exit.png");
endMenu = new Image("data/END.png");
Drawing The Door And End Menu(Updated Render Cycle:


 if (!paused && !dead && !end){

  BG.draw(0,0);
  BlockMap2.tmaps.render(0, 0);
  door.draw(1215, 865);
  g.drawAnimation(player, x , y);
  g.drawAnimation(ai1, AI1x , AI1y);
  g.drawAnimation(ai2, AI2x , AI2y);
  g.drawAnimation(ai3, AI3x , AI3y);
  g.drawAnimation(ai4, AI4x , AI4y);
  g.drawAnimation(ai5, AI5x , AI5y);
  g.drawAnimation(ai6, AI6x , AI6y);

 }else if(paused){
  pauseMenu.draw(0,0);

 }else if(dead){
  deadMenu.draw(0,0);
 }else if(end){
  endMenu.draw(0,0); 
 }
}
Using The End Menu:


 if(end && !paused && !dead){
   
  if((mouseX > 1025.0 && mouseX < 1245.0) && (mouseY > 842.0 && mouseY < 928.0)){
   if (input.isMousePressed(Input.MOUSE_LEFT_BUTTON)){
    Level2.stop();
    Menu.MainMusic.loop();
    sbg.enterState(0);
   }
  } 
 }
Completing The Level:


 if((x > 1214 && x < 1216) && (y > 863 && y < 867)){
  end = true;
  x = 57.0f;
  y = 853.0f;
 }

After the code for Level 2 was fully complete I went back to the first level and added the code to continue to the second level in. The code that I added is shown below:

Completing The First Level:


  if((x > 1215 && x < 1217) && (y > 575 && y < 577)){
   Level1.stop();
   Play2.Level2.loop();
   sbg.enterState(2);
   y = 32f;
   x= 32f;
  }

After this code had been added to the Game it was fully complete from this I thought what had been completed and what had been scrapped from the original idea and I will be discussing this in the next post that will be put up after this one.

Sunday, 10 March 2013

Creating The Game - 10/03/2013 Continued

This is a continuation of the 10/03/2013 Update post. In this section of the update I will be showing how the pause and death menus were implemented into the game. To start with just like the controls page on the main menu screen I started with two boolean variables each one indication whether of not the game was paused or if the player was dead, these both started as false in the beginning. If the player hit the P button on the keyboard then the game would become paused for this I had to update every section of the play class with the code below to allow the game to draw the menu when the boolean turned to true and also allow the user to use the option that are displayed when the pause menu is shown, when the P button is hit again the menu will disappear allowing the game to continue. The code for all of this is below:

Menu Initialisation

 pauseMenu = new Image("data/PausedMenu.png");
 deadMenu = new Image("data/deadMenu.png");

Sound Initialisation

 death = new Sound("data/Death_Tune.ogg");

Render Loop Updated

public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {

 if (!paused && !dead){

  BG.draw(0,0);
  BlockMap.tmap.render(0, 0);
  g.drawAnimation(player, x , y);
  g.drawAnimation(ai, AIx, AIy);

 }else if(paused){
  pauseMenu.draw(0,0);

 }else if(dead){
   deadMenu.draw(0,0);
 }

}

Logic Loop Updated

public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {

 Input input = gc.getInput();
 float floatDelta = delta*0.1f;

 mouseX = gc.getInput().getMouseX();
 mouseY = gc.getInput().getMouseY();

 if(dead && !paused){
   
  if ((mouseX > 468.0 && mouseX < 762.0) && (mouseY > 395.0 && mouseY < 495.0)){
   if(input.isMousePressed(Input.MOUSE_LEFT_BUTTON)){
    y = 32f;
    x = 32f;
    AIx = 480;
    AIy = 640;
    dead = false;
    Level1.play();
   }
  }

  if ((mouseX > 468.0 && mouseX < 762.0) && (mouseY > 552.0 && mouseY < 652.0)){
   if(input.isMousePressed(Input.MOUSE_LEFT_BUTTON)){
    System.exit(0);
   }
  }

 }

 if(paused && !dead){

  if ((mouseX > 511.0 && mouseX < 730.0) && (mouseY > 375.0 && mouseY < 460.0)){
   if(input.isMousePressed(Input.MOUSE_LEFT_BUTTON)){
    paused  = false;
   }
  }

  if ((mouseX > 511.0 && mouseX < 730.0) && (mouseY > 500.0 && mouseY < 585.0)){
   if( input.isMousePressed(Input.MOUSE_LEFT_BUTTON)){
    System.exit(0);
   }
  }
 }

 if (!paused && !dead){

The code above checks to see which of the states the player is currently in, if the player is paused then the game checks to see if the played is clicking in any of the correct areas to perform the desired actions from the pause menu, this is also done if the player is dead and is trying to click on the restart button on the death menu. The very last line of the code above checks to see if the user is in a normal state e.g. not dead or paused and if so the normal game logic continues uninterrupted. Because the death menu is now set up ready to be used the correct code can be added to the AI collision detection to show the death menu when hit and also when the played falls down a pit in the level. The code for both of these is shown below:

Falling Death Code:


  if (y > 960){
   dead = true;
  }

Updated AI Collision Code:


  if(playerPoly.intersects(AIPoly)){
   dead = true;
   Level1.stop();
   death.play();
  }

As the main function of the game are now in place I can reuse all of the code that has been written for this level to create a second level for the game, but lastly on this level I will have to create an exit to the second level by using the door sprite that Stephen has created. The simple code to add a door to the level is below and the code to continue onto the next level will be added when the level is completed.

Initialising the Door:


door = new Image("data/Exit.png");

Drawing the Door (Updated Render Loop):


public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {

 if (!paused && !dead){

  BG.draw(0,0);
  BlockMap.tmap.render(0, 0);
  door.draw(1216, 576);
  g.drawAnimation(player, x , y);
  g.drawAnimation(ai, AIx, AIy);

 }else if(paused){
  pauseMenu.draw(0,0);

 }else if(dead){
  deadMenu.draw(0,0);
 }

}

Creating The Game - 10/03/2013

This week has been a little less productive than the previous two weeks but there has still been progress and the project is very close to completion which may be one more week of work before it is fully completed. This week Stephen has handed me all of the remaining Graphics assets including the bricks for level 2 and also all of the menus that will be used within the game such as the pause menu etc. After receiving all of these materials I decided to focus on the creation of all of the menus within the game allowing the user to navigate around the game.

First of all is the main menu that the user will be first greeted with when entering the game. Here the user will be able to start the game, look at the controls or exit the game. To start with I set up the main menu class allowing me to get started on adding the main menu image to the screen the code for this is as follows:

Main Menu Initial Code:
import org.newdawn.slick.state.*;
import org.newdawn.slick.*;

public class Menu extends BasicGameState {

 private Image mainMenu;
 public static Music MainMusic;

 public Menu(int state) {

 }

public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
  mainMenu = new Image("data/MainMenu.png");
  MainMusic = new Music("data/Title_Music.ogg");
  MainMusic.loop();
 }

public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {
   mainMenu.draw(0,0);
 }

public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {
  Input input = gc.getInput();

  float mouseX = 0, mouseY = 0;

  mouseX = gc.getInput().getMouseX();
  mouseY = gc.getInput().getMouseY();

 }

 public int getID(){
  return 0;
 }
}

This code draws the main menu image to the screen and also get the current x and y co-ordinates of the mouse pointer on the screen, this was then used to see if the user was within the acceptable bound of the buttons before clicking allowing them to perform certain actions. After doing this I moved on to allowing the user to start the game from this screen and also looking at the controls and exiting the game. The code for that is below:

Starting The Game:


if(!controls && !controls2){ 
                if((mouseX > 512.0 && mouseX < 735.0) && (mouseY > 556.0 && mouseY < 642.0)){
   if (input.isMousePressed(Input.MOUSE_LEFT_BUTTON)){
    MainMusic.stop();
    Play.Level1.loop();
    sbg.enterState(1);
    }
  }

Exiting The Game:


  
if((mouseX > 512.0 && mouseX < 735.0) && (mouseY > 680.0 && mouseY < 767.0)){
   if (input.isMousePressed(Input.MOUSE_LEFT_BUTTON)){
    System.exit(0);
   }
  }

Contols Page:


  
if((mouseX > 512.0 && mouseX < 735.0) && (mouseY > 804.0 && mouseY < 890.0)){
   if (input.isMousePressed(Input.MOUSE_LEFT_BUTTON)){
    controls = true;
   }
  }

else if (!controls2){
   
  if((mouseX > 1025.0 && mouseX < 1245.0) && (mouseY > 842.0 && mouseY < 928.0)){
   if (input.isMousePressed(Input.MOUSE_LEFT_BUTTON)){
    controls = false;
    controls2=true;
   }
  }
   
  if((mouseX > 42.0 && mouseX < 260.0) && (mouseY > 842.0 && mouseY < 928.0)){
   if (input.isMousePressed(Input.MOUSE_LEFT_BUTTON)){
    controls = false;
   }
  }
   
 } else {
   
  if((mouseX > 1025.0 && mouseX < 1245.0) && (mouseY > 842.0 && mouseY < 928.0)){
   if (input.isMousePressed(Input.MOUSE_LEFT_BUTTON)){
    controls2=false;
   }
  }
 }

All of the code above checks if the mouse is in a certain bounded area between two sets of different co-ordinates, if that mouse if and the left mouse button is clicked then certain actions are performed. The controls page code also checks to see which page of the controls the user is on and responds accordingly either exiting back to the main menu or continuing onto the next page of controls.

As the controls page will be drawn on top of the main menu temporarily then the render code also had to be updated to draw the correct page when the correct button was pressed. The updated render code is below:

Updated Render Loop:


public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {
  if(!controls && !controls2){
   mainMenu.draw(0,0);
  } else if(!controls2) {
   controlsMenu.draw(0,0);
  } else {
   controlsMenu2.draw(0,0);
  }
 }

Updated Initialisation:


 public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
  mainMenu = new Image("data/MainMenu.png");
  controlsMenu = new Image("data/Controls.png");
  controlsMenu2 = new Image("data/ControlsPageNME.png");
  MainMusic = new Music("data/Title_Music.ogg");
  MainMusic.loop();
 }

Sunday, 3 March 2013

Creating The Game - 03/03/2013

This week has been another busy week and a lot of work has been completed on the project bringing us closer to being done with the creation of the game. This week the group only had a very small meeting but Sam had finished all sounds that are needed for the game and has given me these as well as Stephen giving me the sprite that will be used for the AI within the game and the animation frames for this. With all of the new assets that I was given I decided to get the AI within the game working as well as adding the sound effects to all of the respective actions within the game. To see the progression of the code please click read more below.

Sunday, 24 February 2013

Creating The Game - 24/02/2013

This week there has been a large amount of work that has been done on the Game but there is still a lot of work to be done on the game. There has also been no meeting between the members of the group as with it being half term some members were unable to attend due to being out of the country, but I have spoken to Stephen during the week and he has given me the completed animation frames for the character allowing me to see for the first time what the character and animation will look like now that it is in the 32x64 dimensions.

This week I myself have concentrated on getting a pseudo gravity system into the game which I severely underestimated on the complexity of the coding that would have to go into this. To start off I figured out how to get a smooth jump from the character instead of just being able to walk up and down whenever the user pleased meaning that they can press the jump key once and the character will the perform the jump, the complex part of this was handling collisions while in the air allowing for the character to come back down if they were to collide with a block above them while jumping, but this was all figured out over the week and has been successfully implemented into the game along with the feature of the character changing its sprite depending on the direction it is facing, this means that if the user presses the left key the character will now face left but there is still no animation within the game, all of these features have been implemented into the game using the code below.

Jumping Gravity + Sprite Change
if ((input.isKeyPressed(Input.KEY_UP) || input.isKeyPressed(Input.KEY_W)) && !jumping){

   if(lastKeyLeft){
    player = jumpLeft;
   } else {
    player = jumpRight;
   }

   gravSpeeds = -12;
   jumping = true;
   }

   if(jumping && gravSpeeds < 12) { 
    gravSpeeds += 0.5; 
   } 

   if (jumping == false){
    gravSpeeds = 12;
    if (lastKeyLeft == true){
     player = moveLeft;
    } else {
     player = moveRight;
    }
   }

   y += gravSpeeds;
   origY = y - gravSpeeds;

   playerPoly.setY(y);
   if (entityCollisionWith()){

    if (jumping && gravSpeeds < ((gravSpeeds * (-1)))){
     gravSpeeds = 0;
     gravSpeeds += 0.5;
     y += gravSpeeds;
    }

    if ( gravSpeeds > 0) {
     gravSpeeds = 0;
     jumping = false;
     y = origY;
     playerPoly.setY(y);
    }  
   } 


   if (input.isKeyDown(Input.KEY_DOWN) || input.isKeyDown(Input.KEY_S))
   {
    y += floatDelta;
    playerPoly.setY(y);
    if (entityCollisionWith()){
     y -= floatDelta;
     playerPoly.setY(y);
    }
   }

   if (input.isKeyDown(Input.KEY_LEFT) || input.isKeyDown(Input.KEY_A))
   {
    lastKeyLeft = true;

    if (jumping){
     player = jumpLeft;
     jumpLeft.update(delta);
    } else {
     player = moveLeft;
     moveLeft.update(delta);
    }
    x -= floatDelta;
    playerPoly.setX(x);
    if (entityCollisionWith()){
     x += floatDelta;
     playerPoly.setX(x);
    }
   } else {
    moveLeft.setCurrentFrame(0);
   }

   if (input.isKeyDown(Input.KEY_RIGHT) || input.isKeyDown(Input.KEY_D))
   {
    lastKeyLeft = false;

    if (jumping){
     player = jumpRight;
     jumpRight.update(delta);
    } else {
     player = moveRight;
     moveRight.update(delta);
    }
    x += floatDelta;
    playerPoly.setX(x);
    if (entityCollisionWith()){
     x -= floatDelta;
     playerPoly.setX(x);
    }
   }
   else {
    moveRight.setCurrentFrame(0);
   }

Animation Code
  player = new Animation();
  player.setAutoUpdate(true);
  Image [] walkRight = {new Image ("data/Sprites/CharStand.png"), 
                        new Image ("data/Sprites/CharStep1.png"), 
                        new Image ("data/Sprites/CharStep2.png")};
  Image [] walkLeft = {new Image ("data/Sprites/CharStandBACKWARDS.png"), 
                       new Image ("data/Sprites/CharStep1BACKWARDS.png"), 
                       new Image ("data/Sprites/CharStep2BACKWARDS.png")};
  Image [] jumpingLeft = {new Image ("data/Sprites/CharJumpBACKWARDS.png")};
  Image [] jumpingRight = {new Image ("data/Sprites/CharJump.png")};

  moveRight = new Animation(walkRight, 200, false);
  moveLeft = new Animation(walkLeft , 200, false);
  jumpRight = new Animation(jumpingRight, 200, false);
  jumpLeft = new Animation(jumpingLeft, 200, false);

  jumpRight.setPingPong(true);
  jumpLeft.setPingPong(true);
  moveRight.setPingPong(true);
  moveLeft.setPingPong(true);

  player = moveRight;

Sunday, 17 February 2013

Creating The Game - 17/02/2013

This week I have been concentrating on getting the collision within the game working, and this was one of the hardest things that I have done with the project to date. But first I will discuss the what was said at the short group discussion that we had. Stephen has created some more tiles for me to use within the map creation but we have decided that we are not going to use them, because of this he has started creating the animation frames for the character walking and jumping that I will use to animate the character in the game. Sam has completed the jump sound which will be played when the character jumps within the game to his liking and has started on a collection sound for picking up coins. Andy has started to create the real flash animation from one of his designs that he has chosen for this and the whole project is still moving in the right direction.

This week as stated before I have been focusing on getting the collision working within the game. This means that the character will not be able to move where there is a block being rendered on the screen. As I had originally thought, this was extremely hard to get the grasp of but finally after looking through many different resources I understand how this is done and have implemented it successfully into the game. The basics of the collision system are that the TileD map that I created is loaded as a blockmap allowing Slick2D to read each tile and see if anything is being drawn there according to a specific tile ID. If there is a tile meant to be there then this is added to an array of entities which store the size of the block and where it is. Once this is done a polygon box is drawn around the players character and all of the blocks that are in the map, when the user is attempting to move the game checks to see if these polygon boxes ever intersect by looking through each object in the array and making sure the co-ordinates never intersect, if they do the movement is blocked and stops the character from moving through this object. All of the code that was written for this is down below.

BlockMap Class
import java.util.ArrayList;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.tiled.TiledMap;
 
public class BlockMap {
	public static TiledMap tmap;
	public static int mapWidth;
	public static int mapHeight;
	private int square[] = {1,1,31,1,31,31,1,31}; //square shaped tile
	public static ArrayList(objects) entities;
 
	public BlockMap(String ref) throws SlickException {
		entities = new ArrayList(objects)();
		tmap = new TiledMap(ref, "data");
		mapWidth = tmap.getWidth() * tmap.getTileWidth();
		mapHeight = tmap.getHeight() * tmap.getTileHeight();
 
		for (int x = 0; x < tmap.getWidth(); x++) {
			for (int y = 0; y < tmap.getHeight(); y++) {
				int tileID = tmap.getTileId(x, y, 0);
				if (tileID == 1) {
					entities.add(
                                        new Block(x * 32, y * 32, square, "square")
                                        );
				}
			}
		}
	}
}

Block Class
import org.newdawn.slick.Graphics;
import org.newdawn.slick.geom.Polygon;
 
public class Block  {
	public Polygon poly;
	public Block(int x, int y, int test[],String type) {
        poly = new Polygon(new float[]{
				x+test[0], y+test[1],
				x+test[2], y+test[3],
				x+test[4], y+test[5],
				x+test[6], y+test[7],
        });   
	}
 
	public void update(int delta) {
	}
 
	public void draw(Graphics g) {
		g.draw(poly);
	}
}

Collision Check Method
	public boolean entityCollisionWith() throws SlickException {
		for (int i = 0; i < BlockMap.entities.size(); i++) {
			Block entity1 = (Block) BlockMap.entities.get(i);
			if (playerPoly.intersects(entity1.poly)) {
				return true;
			}       
		}       
		return false;

	}

Updated Game Code - Movement
		if (input.isKeyPressed(Input.KEY_UP)){
			y -= floatDelta;
			playerPoly.setY(y);
			if (entityCollisionWith()){
				y += floatDelta;
				playerPoly.setY(y);
			}
		}

		if (input.isKeyDown(Input.KEY_DOWN))
		{
			y += floatDelta;
			playerPoly.setY(y);
			if (entityCollisionWith()){
				y -= floatDelta;
				playerPoly.setY(y);
			}
		}

		if (input.isKeyDown(Input.KEY_LEFT))
		{
			x -= floatDelta;
			playerPoly.setX(x);
			if (entityCollisionWith()){
				x += floatDelta;
				playerPoly.setX(x);
			}
		}

		if (input.isKeyDown(Input.KEY_RIGHT))
		{
			x += floatDelta;
			playerPoly.setX(x);
			if (entityCollisionWith()){
				x -= floatDelta;
				playerPoly.setX(x);
			}
		}

	}