{"id":6973,"date":"2014-05-16T01:17:29","date_gmt":"2014-05-16T01:17:29","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/16\/problem-about-slick2d-collection-of-common-programming-errors\/"},"modified":"2014-05-16T01:17:29","modified_gmt":"2014-05-16T01:17:29","slug":"problem-about-slick2d-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/16\/problem-about-slick2d-collection-of-common-programming-errors\/","title":{"rendered":"problem about slick2d-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/31707501403ae007cda50932fe9bf1d5?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nuser2908845<br \/>\njava rotation collision slick2d<br \/>\nI have started to develop a basic game in java. The view is top down, the player is represented by a green circle, and the enemies by red circles. The player has a sword. If an enemy touches the player, it gets hurt. If the sword touches an enemy, it is killed.The basic collision detection of the player&lt;-&gt;enemies and enemies&lt;-&gt;sword work (i use bounding ellipses). But i cannot rotate the ellipse representing the sword around the player. It stays at one place. I have tried with Transform.cr<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dc40cbe30fed9d8b915ff899b9d32e68?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nDilanHanrahan<br \/>\njava lwjgl slick2d<br \/>\nI&#8217;m using slick2d and in my Java application. In my render method I use a method called changeBackground();@Override public void render(GameContainer gc, StateBasedGame sbg, Graphics g)throws SlickException { changeBackground(g); }changeBackground();public void changeBackground(Graphics g) throws SlickException{Thread.sleep(500);g.setBackground(new org.newdawn.slick.Color(0, 255, 0);Thread.Sleep(500);g.setBackground(new org.newdawn.slick.Color(255, 0, 0);changeBackground(g); }When I run my appli<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5c8fc02a881af739969e39d7982d2b6c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ngenpfault<br \/>\njava opengl lwjgl slick2d<br \/>\nI already have a variable calledImage spriteImage;later on in the code I state what it isImage spriteImage = new Image(&#8220;content\/man.png&#8221;);this code crashes my Slick2D application. What is the difference betweenImage spriteImage = new Image(&#8220;content\/man.png&#8221;);andspriteImage = new Image(&#8220;content\/man.png&#8221;);(Which actually works)<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/19a485386fcd0c3d949e7fd5a7efd880?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMatthew<br \/>\njava slick2d<br \/>\nWhen I debug the game in eclipse the game works fine. However, when I make runnable jar out of it the game crashes when enemy gets hit, the rest of the game works fine except that part. What do I do, how do I debug runnable jar?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/hDd5P.jpg?s=32&amp;g=1\" \/><br \/>\nNcAdams<br \/>\njava animation slick2d<br \/>\nI&#8217;m working on a game with some basic graphics that utilizes Slick2D. In order to display an animation I have to display an image that&#8217;s both rotated and scaled, so I quickly discovered that none of the methods in the Animation class would work for me.The solution I came up with was to draw the image at Animation.getFrame() (the animation&#8217;s current image). To update the image I call the following lines of code:System.out.println(&#8220;Updating animation data&#8230;&#8221;); a.setAutoUpdate(false);a.update(delt<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8fcf279def5c1abd4cdf30b974dd8787?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDavid<br \/>\njava opengl slick2d<br \/>\nWhenever I use the method getGraphics() from org.newdawn.slick.Image in fullscreen mode, it causes a crash. It works perfectly fine in windowed mode, and I&#8217;ve tried doing stuff like Graphics g = new Image(100,100).getGraphics(), this also causes the crash.I am using Slick2DThis is the output I get: Tue May 07 14:58:08 CEST 2013 INFO:Slick Build #264 Tue May 07 14:58:09 CEST 2013 INFO:LWJGL Version: 2.9.0 Tue May 07 14:58:09 CEST 2013 INFO:OriginalDisplayMode: 1366 x 768 x 32 @59Hz Tue May 07 14:<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4d348b066871921c9cc428d31d690d38?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1897479<br \/>\njava slick2d<br \/>\nI have problem with implementation game on website. I have tried to do like in this site : http:\/\/ninjacave.com\/slickappletI&#8217;m receiving this error:ERROR:MainPackage.TGame java.lang.InstantiationException: MainPackage.TGame at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.newdawn.slick.AppletGameContainer.init(AppletGameContainer.java:124) at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:766) at org.lwjgl.util.applet.Apple<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dd540e3abba3e5ba4bda1f6d31f03855?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmr_yogurt<br \/>\njava lwjgl slick2d slick<br \/>\nI have recently been programming a platforming game in java, and I have run into a problem when I tried to use a separate class to store my map (tiled). I then tried to fix it by moving the map into the main class, and it didn&#8217;t help.This is the code that is causing the problem (When the world.map1.render(0,0) is removed, no problem exists) &#8211; I know that I should be using getters and setters. I&#8217;m just find them a pain.public void render(GameContainer arg0, Graphics arg1) throws SlickException {<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2e1b27ca5ec6f555dfb4eb667707c092?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTwister1002<br \/>\njava applet slick2d<br \/>\nI have been trying to get a slick application to work on a website for awhile now, and I have the HTML code correct, I know that for sure, however I am getting an error from the applet saying this:Initializing real applet Mon May 20 17:07:24 EDT 2013 ERROR:Game.GameBoard java.lang.ClassNotFoundException: Game.GameBoard at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClas<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n<p>I discovery a place to host code\u3001demo\u3001 blog and websites.<br \/>\nSite access is fast but not money<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.m5zn.com\/newuploads\/2014\/01\/30\/jpg\/e7da807964b1fff.jpg\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>user2908845 java rotation collision slick2d I have started to develop a basic game in java. The view is top down, the player is represented by a green circle, and the enemies by red circles. The player has a sword. If an enemy touches the player, it gets hurt. If the sword touches an enemy, it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6973","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6973"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6973\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}