• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Donal Byrne

Members
  • Content count

    18
  • Joined

  • Last visited

Community Reputation

150 Neutral

About Donal Byrne

  • Rank
    Member
  1. ok so I got the image on the screen and did key inputs, but instead of moving cleanly it leaves behind a trail of the image.  Its like its just cloning itself instead of moving.   It has to be something to do with the loop right? package game3; import java.awt.*; import java.awt.*; import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.image.*; import java.io.IOException; import java.util.logging.*; import java.util.logging.*; import javax.swing.*; /**, * * @author djb */ public class Game extends Canvas implements Runnable{ //Player p; private boolean running = false; private Thread thread; BufferedImage player = null; int speed = 2; private Player p; public void init() { BufferedImageLoader loader = new BufferedImageLoader(); try{ player = loader.loadImage("/images/p1Up.png"); }catch(IOException e) { e.printStackTrace(); } addKeyListener(new KeyInput(this)); this.requestFocus(); p = new Player(200,200,this); } private synchronized void start() { if(running) return; running = true; thread = new Thread(this); thread.start(); } private synchronized void stop() { if(!running) return; running = false; try { thread.join(); } catch (InterruptedException e) { e.printStackTrace(); } System.exit(1); } public void run() { //game loop init(); long lastTime = System.nanoTime(); final double amountOfTicks = 60.0; double ns = 1000000000 / amountOfTicks; double delta = 0; int updates = 0; int frames = 0; long timer = System.currentTimeMillis(); while(running) { //game loop long now = System.nanoTime(); delta+=(now - lastTime)/ns; lastTime = now; if(delta >= 1) { tick(); updates++; delta--; } render(); frames++; if(System.currentTimeMillis() - timer > 1000) { timer += 1000; System.out.println(updates + "ticks, Fps " + frames); updates = 0; frames = 0; } } stop(); } private void tick() { p.tick(); } private void render() { BufferStrategy bs = this.getBufferStrategy(); if(bs == null) { createBufferStrategy(1); return; } Graphics g = bs.getDrawGraphics(); //put objects between here and dispose to draw stuff //g.drawImage(player, 100, 100,32 ,32, this); p.render(g); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g.dispose(); bs.show(); } public void keyPressed(KeyEvent e) { int key = e.getKeyCode(); if(key==KeyEvent.VK_RIGHT){ p.setX(p.getX() + 5*speed); }else if(key==KeyEvent.VK_LEFT){ p.setX(p.getX() - 5*speed); }else if(key==KeyEvent.VK_UP){ p.setY(p.getY() - 5*speed); } else if(key==KeyEvent.VK_DOWN){ p.setY(p.getY() + 5*speed); } } public void keyReleased(KeyEvent e) { } public static void main(String[]args) { Game game = new Game(); JFrame frame = new JFrame(); frame.pack(); frame.setSize(640,480); frame.setResizable(false); frame.setLocationRelativeTo(null); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(game); game.setFocusable(true); game.start(); } }
  2. Yeah that sorted it out. Im such a idiot!   Yeah that makes sense, sorry about that. won't happen again.   Thanks a lot 
  3. I am trying to increase performance with buffered images. I have made a game loop that has increased my fps but i also want buffered images, however these aren't working.   its supposed to show a black background and print the amount of ticks and fps in the console package game3; import java.awt.*; import java.awt.*; import java.awt.image.*; import java.awt.image.*; import java.util.logging.*; import java.util.logging.*; import javax.swing.*; /**, * * @author djb */ public class Game extends Canvas implements Runnable{ private boolean running = false; private Thread thread; private BufferedImage image = new BufferedImage(640,480,BufferedImage.TYPE_INT_RGB); private synchronized void start() { if(running) return; running = true; thread = new Thread(this); thread.start(); } private synchronized void stop() { if(!running) return; running = false; try { thread.join(); } catch (InterruptedException e) { e.printStackTrace(); } System.exit(1); } public void run() { //game loop long lastTime = System.nanoTime(); final double amountOfTicks = 60.0; double ns = 1000000000 / amountOfTicks; double delta = 0; int updates = 0; int frames = 0; long timer = System.currentTimeMillis(); while(running) { //game loop long now = System.nanoTime(); delta+=(now - lastTime)/ns; lastTime = now; if(delta >= 1) { tick(); updates++; delta--; } render(); frames++; if(System.currentTimeMillis() - timer > 1000) { timer += 1000; System.out.println(updates + "ticks, Fps " + frames); updates = 0; frames = 0; } } stop(); } private void tick() { } private void render() { BufferStrategy bs = this.getBufferStrategy(); if(bs == null) { createBufferStrategy(3); return; } Graphics g = bs.getDrawGraphics(); //put objects between here and dispose to draw stuff g.drawImage(image, 0, 0, 630, 480, this); g.dispose(); bs.show(); } public static void main(String[]args) { Game game = new Game(); JFrame frame = new JFrame(); frame.pack(); frame.setSize(640,480); frame.setResizable(false); frame.setLocationRelativeTo(null); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); game.start(); } } could really use some help, thanks
  4. what happens is that it shows a blank screen. No compile errors just a blank screen. Its supposed to show a race track with two squares(cars) moving around it using wsad or ijkl as directional controls. Its also supposed to have collision detection.   Like i said the screen goes blank when i add the Move classes
  5. Everything was fine until i added in the Move classes.No idea what to do, any help would be appreciated package g1p1; import javax.swing.*; import javax.swing.event.*; import java.awt.*; import java.awt.event.*; public class G1P1 extends JFrame { //screen size final int WIDTH = 900, HEIGHT = 650; //keep track of speed double p1Speed = 0.5, p2Speed = 0.5; //direction var final int UP=0, DOWN = 1, RIGHT=2, LEFT=3; //PLAYERS DIRECTION int p1Direction = UP; int p2Direction = UP; //gives perameters of objects //border Rectangle left = new Rectangle(0,0,50,HEIGHT); Rectangle right = new Rectangle(850,0,50,HEIGHT); Rectangle top = new Rectangle(0,0,WIDTH, HEIGHT/9); Rectangle bottom = new Rectangle(0,600,WIDTH,100); Rectangle center = new Rectangle(200,(int)((HEIGHT/9)*2.5),575,(HEIGHT/9)*4); //OBSTACLES Rectangle obstacle = new Rectangle(250,0,100,140); Rectangle obstacle2 = new Rectangle(300,400,WIDTH/10,150); Rectangle obstacle3 = new Rectangle(2*(WIDTH/3),(int)((HEIGHT/9)*5),WIDTH/10,HEIGHT/4); Rectangle obstacle4 = new Rectangle(450,525,100,100); Rectangle obstacle5 = new Rectangle(WIDTH/2,125,WIDTH/30,HEIGHT/4); //FINISH LINE Rectangle finish = new Rectangle(50,(HEIGHT/2)-HEIGHT/9,(int)((WIDTH/9)*1.5), HEIGHT/70); //p1 car Rectangle p1 = new Rectangle(70,330,WIDTH/30,WIDTH/30); //p2 car Rectangle p2 = new Rectangle(150,395,WIDTH/30,WIDTH/30); //STARTING LINE FOR OUTER CAR Rectangle lineO = new Rectangle(50,HEIGHT/2,(int)((WIDTH/9)*1.5)/2,HEIGHT/140); //STARTING LINE FOR INNER PLAYER Rectangle lineI = new Rectangle(125,(HEIGHT/2)+(HEIGHT/10),(int)((WIDTH/9)*1.5)/2, HEIGHT/140); //THE CONSTRUCTOR - makes the screen public G1P1() { //creates JFrame super("radical racing"); setSize(WIDTH,HEIGHT); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); /* Move1 m1 = new Move1(); Move2 m2 = new Move2(); m1.start(); m2.start();*/ } //THIS WILL DRAW objects of the game public void paint(Graphics g) { super.paint(g); //draw the background g.setColor(Color.DARK_GRAY); g.fillRect(0,0,WIDTH,HEIGHT); //make the border green g.setColor(Color.GREEN); //USING THE RECTANGLES TO DRAW IT g.fillRect(left.x,left.y,left.width,left.height); g.fillRect(right.x,right.y,right.width,right.height); g.fillRect(top.x,top.y,top.width,top.height); g.fillRect(bottom.x,bottom.y,bottom.width,bottom.height); g.fillRect(center.x,center.y,center.width,center.height); g.setColor(Color.GREEN); g.fillRect(obstacle.x,obstacle.y,obstacle.width,obstacle.height); g.fillRect(obstacle2.x,obstacle2.y,obstacle2.width,obstacle2.height); g.fillRect(obstacle3.x,obstacle3.y,obstacle3.width,obstacle3.height); g.fillRect(obstacle4.x,obstacle4.y,obstacle4.width,obstacle4.height); g.fillRect(obstacle5.x,obstacle5.y,obstacle5.width,obstacle5.height); //set starting line to white g.setColor(Color.WHITE); //DRAW THE STARTING LINE g.fillRect(lineO.x,lineO.y,lineO.width,lineO.height); g.fillRect(lineI.x,lineI.y,lineI.width,lineI.height); //SET COLOR OF FINISH LINE TO YELLOW g.setColor(Color.YELLOW); //DRAW FINISH LINE g.fillRect(finish.x,finish.y,finish.width,finish.height); //SET COLOR OF P1 TO BLUE g.setColor(Color.blue); g.fill3DRect(p1.x, p1.y, p1.width, p1.height,true); //SET COLOR OF P2 TO red g.setColor(Color.red); g.fill3DRect(p2.x, p2.y, p2.width, p2.height,true); } //add speed + movement private class Move1 extends Thread implements KeyListener { @Override public void run() { //wake up key listener addKeyListener(this); while(true) { try { //refresh screen repaint(); //check for collision on walls, if so, make it slower if(p1.intersects(left)||p1.intersects(right)|| p1.intersects(top) ||p1.intersects(bottom)|| p1.intersects(obstacle)||p1.intersects(obstacle2) ||p1.intersects(obstacle3)||p1.intersects(obstacle4) ||p1.intersects(obstacle5)|| p1.intersects(p2)) { p1Speed =-4; } //if it hits the center do the same if(p1.intersects(center)) { p1Speed =-2.5; } //increase speed if(p1Speed<=5) { p1Speed+=0.2; } //move player based on direction if(p1Direction==UP) { p1.y-=(int)p1Speed; } if(p1Direction==DOWN) { p1.y+=(int)p1Speed; } if(p1Direction==LEFT) { p1.x-=(int)p1Speed; } if(p1Direction==LEFT) { p1.x+=(int)p1Speed; } //delay refresh Thread.sleep(75); } catch(Exception e) { break; } } } //IMPLEMENT METHOD FROM KEY LISTENER @Override public void keyPressed(KeyEvent event) { } //IMPLEMENT METHOD FROM KEY LISTENER @Override public void keyReleased(KeyEvent event) { } //IMPLEMENT METHOD FROM KEY LISTENER @Override public void keyTyped(KeyEvent event) { if(event.getKeyChar()=='a') { p1Direction = LEFT; } if(event.getKeyChar()=='d') { p1Direction = RIGHT; } if(event.getKeyChar()=='s') { p1Direction = DOWN; } if(event.getKeyChar()=='w') { p1Direction = UP; } } } //add speed + movement private class Move2 extends Thread implements KeyListener { @Override public void run() { //wake up key listener addKeyListener(this); while(true) { try { //refresh screen repaint(); //check for collision on walls, if so, make it slower if(p2.intersects(left)||p2.intersects(right)|| p2.intersects(top) ||p2.intersects(bottom)|| p2.intersects(obstacle)||p2.intersects(obstacle2) ||p2.intersects(obstacle3)||p2.intersects(obstacle4) ||p2.intersects(obstacle5)|| p2.intersects(p1)) { p2Speed =-4; } //if it hits the center do the same if(p2.intersects(center)) { p2Speed =-2.5; } //increase speed if(p2Speed<=5) { p2Speed+=0.2; } //move player based on direction if(p2Direction==UP) { p2.y-=(int)p1Speed; } if(p2Direction==DOWN) { p2.y+=(int)p1Speed; } if(p1Direction==LEFT) { p1.x-=(int)p1Speed; } if(p2Direction==LEFT) { p2.x+=(int)p1Speed; } //delay refresh Thread.sleep(75); } catch(Exception e) { break; } } } //IMPLEMENT METHOD FROM KEY LISTENER @Override public void keyPressed(KeyEvent event) { } //IMPLEMENT METHOD FROM KEY LISTENER @Override public void keyReleased(KeyEvent event) { } //IMPLEMENT METHOD FROM KEY LISTENER @Override public void keyTyped(KeyEvent event) { if(event.getKeyChar()=='j') { p2Direction = LEFT; } if(event.getKeyChar()=='l') { p2Direction = RIGHT; } if(event.getKeyChar()=='k') { p2Direction = DOWN; } if(event.getKeyChar()=='i') { p2Direction = UP; } } } public static void main(String[]args) { new G1P1(); } }
  6. Trying to make a VERY simple inventory for unity2D. I would like to be able to pick up objects, drop them and have them fill up an inventory screen.   Can be made in either JS or C#   Thanks
  7. ok so i just finished Ray Wenderlichs tutorial on how to make a simple game for iPhone. I have started to expand on it by adding in new graphics,sounds etc. I have been trying to add animation to the enemies but it hasn’t been working out if you aren’t familiar with the tutorial you can find the finished project at the bottom of this page. http://www.raywenderlich.com/25806/harder-monsters-and-more-levels-how-to-make-a-simple-iphone-game-with-cocos2d-2-x-part-3 I’ve already made my animation sprites, put them through texture packer and all that but any animation methods i try to integrate into the project doesn’t work. any help would be great. thanks
  8. Ok so im in my last year of high school. Im planning to get a degree in computer science and then hopefully get a masters after that. By then I should be a very capable programmer (or at least thats what I'm assuming) I want to start making some games and possibly publishing them on websites like kongregate/miniclip/newgrounds but not sure what way to go about it. Ive made a handful of simple games with Unity3d. I picked that because I thought it would be a better choice in the long run but now I'm not so sure. Ive also learned javaScript and C#. If I just want to make some fun games to add to my portfolio should I stick with Unity or would it be better to use something like Flash, because it seems like a lot of successful indie games are made with it and the games I want to make right now are more 2d games then 3d. Im just wondering if making complete 3d games would be better experience and look better on a portfolio. Also I'm doing all these projects solo which makes me think flash might be easier. Or is there a better engine to use? Ive heard good things about XNA and UDK. As you can see I'm very conflicted and not sure what to do. My end goal is to make a couple of simple, fun indie games to show that i have experience so I can eventually get a good programing job at a AAA company like Ubisoft or Bethesda etc Any advice from experience members of the gaming industry would be really helpful. Thanks a lot
  9. cool thanks also, when I graduate this year I'm planning to get my bachelors degree in computer science and then go on to do a masters. So by then I should have the programming knowledge. I just wana start designing/developing games now so Ill have some experience when i start job hunting
  10. Ok so im 18, Ive been into game development for a bout a year now. Ive learnt javaScript and C#. Ive been primarily been using Unity. Recently I've been wondering if I'm going down the right path. Like would it be more beneficial in the long run to use something like UDK? Also I really want to start working on some of my ideas and start making good games and possibly submit to websites like kongregate/newgrounds etc. But since I'm doing this solo would it be better to use something like flash? it seems like a lot of successful web games are made with that. Kinda of a two part question, any advice would be really appreciated
  11. ok so Im in my last year of high school and I want to go into a career of game development. So i figure i should start getting some experience making games. I can program in java script and have made about 5 standard games using Unity. Now I really want to make an rpg because its my favorite genre. the only thing is Im wondering if unity is the best way to go about it. I just want it to be a simple 2d rpg. Ive made 2d games on Unity but I'm wondering if It would just be better to use game maker or game salad or one of those game engines. Ill probably learn more programing from unity but I think it'll be easier to use software like rpg maker or sphere. Ill will be working with two other people with similar experience. any advice from people who have experience making indie games would be great thanks
  12. Hey guys, So i just recently learned java/javaScript and unity. I want to start building a portfolio and working on some simple games. What would be a good place to start. Like obviously not an rpg, I was thinking of something like a platform game or a shooter, any thoughts? thanks
  13. well its a lot better then it was, i can actually see the track now. only thing is that it only shows player1 (the blue square)
  14. Okay so I'm trying to make a simple racing game. Ive gone over it for a couple of days and I can't see whats wrong with it. Everything seems to be ok but when i run it, it just shows a blank screen instead of the race track. Im starting to think its my computer. Could someone run it on there computer and see if it works for them or if they see whats wrong with the code let me know thanks import javax.swing.*; import javax.swing.event.*; import java.awt.*; import java.awt.event.*; public class S2P2 extends JFrame { final int WIDTH = 900; int HEIGHT = 650; double p1Speed =.5,p2Speed=.5; //create rectangles that will represent the left,right,top,bottom and centre Rectangle left = new Rectangle(0,0,WIDTH/9,HEIGHT); Rectangle right = new Rectangle((WIDTH/9)*9,0,WIDTH/9,HEIGHT); Rectangle top = new Rectangle(0,0,WIDTH,HEIGHT/9); Rectangle bottom = new Rectangle(0,(HEIGHT/9)*9,WIDTH,HEIGHT/9); Rectangle center = new Rectangle((int)((WIDTH/9)*2.5),(int) ((HEIGHT/9)*2.5),(int)((WIDTH/9)*5),(HEIGHT/9)*4); //these obstacles will obstruct the path and make navigating harder Rectangle obstacle = new Rectangle(WIDTH/2,(int)((HEIGHT/9)*7),WIDTH/10,HEIGHT/9); Rectangle obstacle2 = new Rectangle(WIDTH/3,(int)((HEIGHT/9)*5),WIDTH/10,HEIGHT/4); Rectangle obstacle3 = new Rectangle(2*(WIDTH/3),(int)((HEIGHT/9)*5),WIDTH/10,HEIGHT/4); Rectangle obstacle4 = new Rectangle(WIDTH/3,HEIGHT/9,WIDTH/30,HEIGHT/9); Rectangle obstacle5 = new Rectangle(WIDTH/2,(int)((HEIGHT/9)*1.5),WIDTH/30,HEIGHT/4); //the following rectangle is the finish line for both players Rectangle finish = new Rectangle(WIDTH/9,(HEIGHT/2)-HEIGHT/9,(int)((WIDTH/9)*1.5),HEIGHT/70); Rectangle p1 = new Rectangle(WIDTH/9,HEIGHT/2, WIDTH/30,WIDTH/30); Rectangle p2 = new Rectangle(((WIDTH/9)+((int)((WIDTH/9)*1.5)/2)),(HEIGHT/2)+ (HEIGHT/10),WIDTH/30,WIDTH/30); //the constructor public S2P2() { //the following code creates the JFrame super("Radical Racing"); setSize(WIDTH,HEIGHT); setDefaultCloseOperation(EXIT_ON_CLOSE); setVisible(true); //start the inner class (which works on it's own because it is a thread) Move1 m1 = new Move1(); Move2 m2 = new Move2(); m1.start(); m2.start(); } //this will draw the cars and the racetrack public void paint(Graphics g) { super.paint(g); //draw the backround for the racetrack g.setColor(Color.DARK_GRAY); g.fillRect(0,0,WIDTH,HEIGHT); //when we draw, the border will be green g.setColor(Color.GREEN); //the following retangle is the start line for the outer player Rectangle lineO=new Rectangle(WIDTH/9,HEIGHT/2,(int)((WIDTH/9)*1.5)/2,HEIGHT/140); //the following rectangle is the start line for the inner player Rectangle line1=new Rectangle(((WIDTH/9)+((int)((WIDTH/9)*1.5)/2)), (HEIGHT/2)+(HEIGHT/10), (int)((WIDTH/9)*1.5)/2,HEIGHT/140); //now, using the rectangles, draw it g.fillRect(left.x,left.y,left.width,left.height); g.fillRect(right.x,right.y,right.width,right.height); g.fillRect(top.x,top.y,top.width,top.height); g.fillRect(bottom.x,bottom.y,bottom.width,bottom.height); g.fillRect(center.x,center.y,center.width,center.height); g.fillRect(obstacle.x,obstacle.y,obstacle.width,obstacle.height); g.fillRect(obstacle2.x,obstacle2.y,obstacle2.width,obstacle2.height); g.fillRect(obstacle3.x,obstacle3.y,obstacle3.width,obstacle3.height); g.fillRect(obstacle4.x,obstacle4.y,obstacle4.width,obstacle4.height); g.fillRect(obstacle5.x,obstacle5.y,obstacle5.width,obstacle5.height); //set the starting line with colour to white g.setColor(Color.WHITE); //now draw the starting line g.fillRect(lineO.x,lineO.y,lineO.width,lineO.height); g.fillRect(line1.x,line1.y,line1.width,line1.height); //set the colour of the finish line to yellow g.setColor(Color.YELLOW); //now draw the finish line g.fillRect(finish.x,finish.y,finish.width,finish.height); //set the colour to blue for p1 g.setColor(Color.BLUE); //now draw the actual player g.fill3DRect(p1.x,p1.y,p1.width,p1.height,true); //set the color to red for p2 g.setColor(Color.RED); //now draw the actual player g.fill3DRect(p2.x,p2.y,p2.width,p2.height,true); //set the color to blue for p1 g.setColor(Color.BLUE); //now draw the actual player g.fill3DRect(p1.x,p1.y,p1.width,p1.height,true); //set the color to red for p2 g.setColor(Color.RED); //now draw the actual player g.fill3DRect(p2.x,p2.y,p2.width,p2.height,true); } private class Move1 extends Thread { public void run() //This should all be in an infinite loop so that the process repeats. { while(true) { //now put in the try block. This will let //the program exit if there is an error try { //first refresh the screen repaint(); //increase speed a bit if(p1Speed<=5) p1Speed+=.2; p1.y-=p1Speed; //this delays the refresh rate Thread.sleep(75); } catch(Exception e) { //if there is an exception (an error), exit the loop break; } } } } private class Move2 extends Thread { public void run() { //this should all be in an infinite loop so the process repeats while(true) { //now put the code in a "try" block. //this will let the program exit if there is an error try { //first refresh the screen repaint(); //increase the speed a bit if(p2Speed<=5) p2Speed+=.2; p2.y-=p2Speed; //this delays the refresh rate Thread.sleep(75); } catch(Exception e) { //if there is an exception (an error), exitthe loop break; } } } } public static void main(String[]args) { new S2P2(); } }
  15. ok so I found what I did wrong in regards to the inner class and it seems to be clean but for some reason the program isn't working :/