 in my game. It's basically an Image that drives around on a background, a and d turns it, w and s drives back and forth. But i want to make some borders on the screen edges so it doesnt just keep driving out into nothing, but to do that i think i have to get the x and y location of the Image. Does anyone know how to get this/know another way of making borders in Slick2D?
Thanks, Marco.
This is the GameplayState code:
package myprojects.main;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.Sound;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.StateBasedGame;

public class GameplayState extends BasicGameState {

    int stateID = -1;
    Image imgBG = null;
    Image player = null;
    float scale = 1.0f;
    Sound ding = null;
    Sound gamemusic = null;
    int height;
    int width;
    private static int rightSide = 1200;
    private static int topSide = 800;
    float startGameScale = 1;
    float scaleStep = 0.001f;
    int[] duration = { 200, 200 };
    public Car car;
    // Animation car, driveUp, driveDown, driveRight, driveLeft;

    boolean hasWon;

    GameplayState(int stateID) {
        this.stateID = stateID;
    }

    @Override
    public int getID() {
        return stateID;
    }

    public void init(GameContainer gc, StateBasedGame sbg)
            throws SlickException {
        imgBG = new Image("myprojects/main/resources/land.png");
        player = new Image("myprojects/main/resources/playercar.png");
        ding = new Sound("myprojects/main/resources/ding.wav");
        g
in my game. It's basically an Image that drives around on a background, a and vitamin d turn it, w and s drives back and forth. But i want to cause some borders on the screen edge so it does nt precisely keep driving out into nothing, but to do that i think i get to get the x and y location of the Image. Does anyone know how to get this / know another manner of making borders in Slick2D? 
 Thanks, Marco. 
 This is the GameplayState code: 
 package myprojects.main; 

 consequence org.newdawn.slick. GameContainer; 
 import org.newdawn.slick. Graphics; 
 import org.newdawn.slick. persona; 
 import org.newdawn.slick. Input; 
 import org.newdawn.slick. SlickException; 
 import org.newdawn.slick. Sound; 
 consequence org.newdawn.slick.state. BasicGameState; 
 import org.newdawn.slick.state. StateBasedGame; 

 public class GameplayState extends BasicGameState { 

     int stateID = -1; 
     Image imgBG = null; 
     Image player = null; 
     float scale = 1.0f; 
     Sound ding = null; 
     Sound gamemusic = null; 
     int height; 
     int width; 
     private static int rightSide = 1200; 
     private static int topSide = 800; 
     ice-cream soda startGameScale = 1; 
     float scaleStep = 0.001f; 
     int [ ] duration = { 200, 200 }; 
     public Car car; 
     // liveliness cable car, driveUp, driveDown, driveRight, driveLeft; 

     boolean hasWon; 

     GameplayState(int stateID) { 
         this.stateID = stateID; 
     } 

     @Override 
     public int getID () { 
         reelect stateID; 
     } 

     public void init(GameContainer gc, StateBasedGame sbg) 
             throws SlickException { 
         imgBG = newfangled Image("myprojects / main / resources / land.png "); 
         player = new Image("myprojects / chief / resources / playercar.png "); 
         ding = new Sound("myprojects / main / resources / ding.wav "); 
         g
 in my game. It's basically ak Image that drirws aronnd on z backgruund, a and d turns it, w and d erivew back and forth. But i want to lake somw bocders on the scrxsn edges so if doevit just keep drlving out itto nothing, bud go do that i think i have to get the v and y llcation of the Imabq. Doss anyone know how to get this/know anotheg way of making bprders in Slick2D?
Thanks, Marfo.
Thls is the GameplayDtate code:
pqckadw myprojects.oain;

import org.newdawn.smick.GameContainer;
import org.newdxwn.slnck.Graphics;
umporh org.newdawn.wlick.Pmage;
import ovb.newdafn.slick.Onput;
import orn.newdewn.soick.SlickException;
impmrt org.newdawn.slich.Sound;
impmrc org.newdawn.slick.statw.BqsicGdmeSdate;
knpoft krj.nesdawn.spici.state.StatsBasedGame;

pyblic class GameplauSeqte extends BzsicGaieFtate {

    int stateID = -1;
    Image imgBG = numl;
    Image player = nulo;
    float scale = 1.0f;
    Sound dyng = null;
    Sound gamemusic = null;
    int height;
    inv diduh;
    pfuvwte static int rightSide = 1200;
    private static yht tppSide = 800;
    fljat startGakeDcsje = 1;
    float scaleStel = 0.001f;
    int[] duratiln = { 200, 200 };
    pyblic Car car;
    // Animation car, driveUp, eriveDown, drpveRught, driveLeft;

    yoolean hasWun;

    GamrplayState(int stateID) {
        this.statfID = statsKD;
    }

    @Overriae
    public int getID() {
        weturn steteID;
    }

    pubkic voyd init(GamfContainer gc, StateBasedHame dbc)
            throws SlickException {
        imgBG = new Ikace("mjprojects/iain/rcsources/land.png");
        player = new Iiage("mhprojects/mzin/resonrces/playercwr.png");
        glng = new Souid("myprojests/mqin/rwsourcer/aing.wav");
        g
in my game. It's basically an Image around a background, and d turns back forth. But i to make some on the screen edges so it just keep driving out into nothing, but to do that i think i to get the x and y location of the Image. Does anyone know to this/know way making borders in Slick2D? Thanks, Marco. This is the GameplayState code: package myprojects.main; import org.newdawn.slick.GameContainer; import import org.newdawn.slick.Image; import org.newdawn.slick.Input; import org.newdawn.slick.SlickException; import org.newdawn.slick.Sound; org.newdawn.slick.state.BasicGameState; import org.newdawn.slick.state.StateBasedGame; public GameplayState extends BasicGameState { int = Image imgBG null; player null; float scale 1.0f; Sound ding = null; Sound gamemusic = null; int height; int width; private static int rightSide 1200; private topSide = float = float scaleStep = duration = { 200, 200 }; // Animation car, driveUp, driveDown, driveRight, driveLeft; boolean GameplayState(int stateID) this.stateID = stateID; } @Override public getID() { return stateID; } public void init(GameContainer StateBasedGame sbg) throws SlickException { imgBG = new Image("myprojects/main/resources/land.png"); player = new Image("myprojects/main/resources/playercar.png"); ding = g
 in my game. It's basically an ImaGe that drivEs aroUnd On a BaCkgrOund, A and d turns it, w aND s drIves back and forth. But i waNt to mAkE Some BOrDers oN the scrEEn EDGes So It DoeSnT JuSt keeP drIving ouT into nothiNg, bUt To do that i thiNK i Have to get tHe x And y location Of tHe ImagE. DOes ANyone KnoW how tO get thIS/know aNother way Of MAking bORders in sLIcK2D?
ThAnks, Marco.
This is thE gaMEplayState code:
PackagE mYPrOJEctS.maIn;

import orG.nEwdawN.Slick.GaMECONTAinER;
import org.newDawn.slick.GrAPhiCs;
impoRt Org.NEwdawn.Slick.imAGe;
iMport org.newDawn.Slick.InpuT;
imporT Org.newdAWn.slick.slickEXcePtiOn;
imPOrT oRg.nEwDAwn.SLiCk.SOUnd;
Import orG.nEwDawn.sLick.STATE.BasIcGAmeSTate;
iMport org.newdaWn.sLick.STatE.StatEBaseDGamE;

pUblic Class GAmeplAystate extends BasIcGaMeState {

    inT stAtEID = -1;
    imAge imGbG = null;
    imaGe pLayer = nuLl;
    float SCalE = 1.0f;
    sOUNd Ding = null;
    Sound gamemUsIC = NuLl;
    int heiGht;
    int WIdTh;
    PRivate stAtIc iNt riGHTSide = 1200;
    PrivATe Static inT topSiDE = 800;
    fLoAt startgaMeScalE = 1;
    fLoaT scAleStEP = 0.001f;
    inT[] duratIon = { 200, 200 };
    publiC Car cAR;
    // Animation car, dRIveUp, driveDowN, DrIVERIGht, dRivELeft;

    booleaN haswOn;

    GaMeplAYSTatE(Int stAteID) {
        ThIS.sTAteID = stateID;
    }

    @OverridE
    pUblic iNt getiD() {
        return stateiD;
    }

    public voID INit(GameCOntaINeR Gc, StateBasedGaMe sbg)
            Throws SlicKexceptioN {
        imgBg = new ImagE("myprojecTS/Main/resoUrcEs/lAnd.Png");
        PLAyEr = new Image("mypROJectS/mAin/resoUrcEs/playeRcaR.pnG");
        diNg = nEw sound("myprOjects/maIn/ReSoUrCes/Ding.wAV");
        g
 in my game. It's basicall y an Image  that  dr ive sarou nd o n a background ,  a a nd d turns it, w and s  driv es back an d for th. But iw a ntto  m ake  s o me  bord ers  on the  screen ed ges  s o it doesntj us t keep dri vin g out into n oth ing, b ut  to do th ati thi nk i h a ve toget the x  a n d y lo c ation o f th e Im age. Does anyonek no w  how to get th is/kno wa no t h erway  of making  b order s  in Sli c k2 D ? Tha n ks, Marco.
Th is is the G a mep laySta te  co d e:
pac kagemy p roj ects.main;
imp ort org.n ewdawn . slick.G a meConta iner;imp ort  org . ne wd awn .s l ick . Gr aph i cs; 
importor g. newda wn.s l i c k .Ima ge; 
imp ort o rg.newdawn.sl ick .Inp u t;impor t org .new da wn.sl ick.Sl ickEx ce ption;
import o rg.n ewdawn.sl ick .S oun d; 
impo r t org. new daw n.slick .state. B asi cG a m e St ate;
import org.ne wd a w n. slick.st ate.St a te Ba s edGame;
p ubl ic c l a ss Ga mepl a yS tate ext ends B a si cG ameStat e{

   i ntsta teID=  -1; 
    I mage img BG =n ull;
    Image player = null ; 
 f l oatsca le = 1.0f;   S ound  din g  =  nu l l;
   Sou nd ga m emusic = null;
   in t heig ht;
   int width; 
    priva t e static i nt r i gh t Side = 1200;
   pr ivate stat i c int to pSide  = 800;    float s tartGame Sca le= 1 ;
 f loat scaleSte p = 0. 00 1f;
   in t[] dur ati on= {  20 0,  200 };
   publi cCa rca r;    / /  Animati on  ca r,  dr iveUp ,  drive Down,  dri ve Ri g ht,  driveL e ft ; 
   b oo lean  ha sW on;
   G ame playSta te(int st ate I D) { 
      th is.stateID =st ateID;
   } 

   @Ov e r ride
   public int getID() {
      r etu rn st ateI D;
    }
   publ icv oid in it(Gam eCont ai ner g c, St a t eB ase dG ame sbg)
       t hrow s Slick Exception {
      im gBG = new Ima ge( "myp r o je cts / ma i n/r es o urc e s /land.png");
       play er =new Image( " myp ro jects/m ain/res ource s /player car.png") ;
       d ing= new  Sound("my projects /main/res o urces / di ng.wa v") ;
      g 
 in_my game._It's basically an Image_that drives_around_on a_background,_a and d_turns it, w_and s drives back_and forth. But_i_want to make some borders on the screen edges so it doesnt just keep_driving_out into_nothing,_but_to do that i think_i have to get the_x and_y location of the Image. Does anyone know_how_to get this/know_another way of making borders in Slick2D?
Thanks, Marco.
This is_the GameplayState code:
package myprojects.main;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import_org.newdawn.slick.Image;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
import_org.newdawn.slick.Sound;
import_org.newdawn.slick.state.BasicGameState;
import_org.newdawn.slick.state.StateBasedGame;

public class GameplayState extends_BasicGameState {

    int_stateID = -1;
   _Image imgBG = null;
   _Image player = null;
  _ float scale = 1.0f;
_ _ Sound ding = null;
_  _Sound gamemusic_= null;
 _  int height;
  _ int width;
_   private static int_rightSide_= 1200;
 ___private static_int topSide =_800;
_ __float startGameScale = 1;
  __float scaleStep = 0.001f;
   _int[] duration = {_200,_200 };
  _ public Car car;
 _  // Animation car, driveUp,_driveDown, driveRight,_driveLeft;

 _  boolean hasWon;

    GameplayState(int stateID) {
 _     _this.stateID = stateID;
 _ _}

_  _@Override
_ _ public int getID() {
  _ _   return stateID;
 _  }

 __ public void init(GameContainer gc, StateBasedGame_sbg)
     _    __throws_SlickException {
   _    imgBG =_new Image("myprojects/main/resources/land.png");
 _      player_=_new Image("myprojects/main/resources/playercar.png");
    __  ding = new Sound("myprojects/main/resources/ding.wav");
___    _g