Java-Gaming.org Hi !
 Featured games (91) games approved by the League of Dukes Games in Showcase (756) Games in Android Showcase (229) games submitted by our members Games in WIP (842) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
 Show Posts Pages: [1]
 1 Game Development / Newbie & Debugging Questions / Re: Tile-based game help! on: 2012-10-21 20:39:14 I have an embarrassingly small understanding of Java, but I'm doing my best to learn I can understand all of that, that's a great example by the way! Thanks mate.
 2 Game Development / Newbie & Debugging Questions / Re: Tile-based game help! on: 2012-10-20 15:58:26 Unfortunately that doesn't work :/ I'm not really sure how to get this to work at all I may just stick to playing other peoples' games haha
 3 Games Center / Showcase / Re: Old School 2D RPG with twists... on: 2012-10-20 15:12:22 Game wasn't playable on my laptop because of the weird screen resolution. My resolution is 1366 x 768. Looks good besides that though!
4  Game Development / Newbie & Debugging Questions / Re: Tile-based game help! on: 2012-10-20 14:52:56
Ah, okay Still getting the same error. The problem line is this one:
 1 `if (pressurePlate.contains(player)){`

And the code for the Polygon is here:
 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15 `for (x = 0; x < mapWidth; x++) {         for (y = 0; y < mapHeight; y++) {            //The third variable in "map.getTiledId(x, y, 0)" is the layer, if you don't know what this is just put 0.            if (level1.getTileId(x, y, 0) == PRESSURE_PLATE_ID) {               Polygon pressurePlate = new Polygon(new float[] { 0, 0, tileWidth, 0, tileWidth, -tileHeight, 0, -tileHeight });               pressurePlate.setX(x * tileWidth);               pressurePlate.setY(y * tileHeight);            }         }      }      //Makes the player a 50x50 square      player = new Polygon(new float[] { 0, 0, tileWidth, 0, tileWidth, -tileHeight, 0, -tileHeight });      // Makes the player start at (50, 50)      player.setX(playerX);      player.setY(playerY);`

Have I made an error there? Thanks again.
5  Game Development / Newbie & Debugging Questions / Re: Tile-based game help! on: 2012-10-19 23:48:41
 1  2  3  4  5  6  7  8  9  10  11  12  13 `java.lang.NullPointerException   at george.game.cells.Level.update(Level.java:83)   at org.newdawn.slick.state.StateBasedGame.update(StateBasedGame.java:268)   at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:657)   at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:408)   at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:318)   at george.game.cells.GameMain.main(GameMain.java:28)Sat Oct 20 00:48:03 BST 2012 ERROR:Game.update() failure - check the game code.org.newdawn.slick.SlickException: Game.update() failure - check the game code.   at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:663)   at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:408)   at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:318)   at george.game.cells.GameMain.main(GameMain.java:28)`

And this is the bit that's wrong
 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15 `if (pressurePlate.contains(player)){            // Set the blocking tile to 1 position higher.            map.setTileId(540, 180, 0, 4);            // Set the old blocking position to a regular tile.            map.setTileId(540, 240, 0, 1);         } else {            // Since the map is now blocked, do the reverse of the above            // Set the blocking tile to default position.            map.setTileId(540, 180, 0, 1);            // Set the position above the blocking wall as a regular tile.            map.setTileId(540, 240, 0, 4);         }      if (pressurePlate.intersects(player) || pressurePlate.contains(player)) {      System.out.println("C'est true");       }`

Very sorry for the delay! Thanks for the help.
 6 Game Development / Newbie & Debugging Questions / Re: Tile-based game help! on: 2012-10-14 21:07:01 That's giving me a NullPointerException
7  Game Development / Newbie & Debugging Questions / Re: Tile-based game help! on: 2012-10-14 20:21:22
Thanks, that was really detailed. A big help

I still don't get this bit though:
 1  2  3  4  5  6  7  8  9 `if (pressurePlate.intersects(player) || pressurePlate.contains(player)){         // Set the blocking tile one higher and it's previous posion to a default walking tile.         map.setTileId(x, y, layerIndex, tileid);         map.setTileId(x, y, layerIndex, tileid);      } else {         // Set the blocking tile to be in the way again.         map.setTileId(x, y, layerIndex, tileid);         map.setTileId(x, y, layerIndex, tileid);      }`

How is this supposed to work? Thanks again.
 8 Game Development / Newbie & Debugging Questions / Re: Tile-based game help! on: 2012-10-14 09:58:10 Struggling to get that working  No errors, and everything else is rendered just fine, but I can't get the pressure plate to work.
 9 Game Development / Newbie & Debugging Questions / Re: Tile-based game help! on: 2012-10-14 00:05:37 A-ha! Finally! I have tiles!Thanks Vladiedoo. Do you have any ideas on how could make my idea work using this system?
 10 Games Center / Featured Games / Re: Overbind on: 2012-10-13 23:30:00 Just discovered this ... Firstly, this is brilliant. Very well done. BUT. I'm stuck on Level 6! And I have been for so long Any hints?
 11 Game Development / Newbie & Debugging Questions / Re: Tile-based game help! on: 2012-10-13 23:23:42 Really going to have to change those names.Thanks, how can I get around that? I'm using Slick's drawImage() to draw the tiles, and the image needs to be declared static to be used as an argument.
 12 Game Development / Newbie & Debugging Questions / Re: Tile-based game help! on: 2012-10-13 22:46:39 Thanks! I still haven't managed to make it work, I'm stuck with my black screen of doom
 13 Game Development / Newbie & Debugging Questions / Re: Tile-based game help! on: 2012-10-13 21:15:30 Oh man, meant to change those before posting
 14 Game Development / Newbie & Debugging Questions / Tile-based game help! on: 2012-10-13 21:01:43 I've been trying to make a tile engine for AAAGES, and I've got further than ever before! Well, I've been able to get the window up without any errors. But still no tiles. At one point there was one red one in the top left corner, but after a bit of tweaking that unfortunately disappeared. I've been using this as my example: https://github.com/captainkraft/Orc-CanyonBut, I've had an idea in my head for a while now for a small and simple-ish top-down puzzle game using the Slick2D library. In the game, you're trying to break out of a jail cell, but walls block your exit. These walls are attached to pressure plates, and you have to stand on them to make the walls move. I've included a basic idea below (Paint ftw):At the minute I've got 2 sorts of tiles, one black and one green. The window just shows empty blackness. I'm not sure if this is the correct way of going about this, so any suggestions are very welcome!Code: http://pastebin.java-gaming.org/3038e0e8a2eThanks!
15  Game Development / Newbie & Debugging Questions / Re: TILES. on: 2012-08-01 01:29:40
Thanks that was some great advice! I've designed the basic idea of the game now. My current task is drawing tiles on the screen. Which is proving to be troublesome :/

So I took a look at the source of your game, and at your blog, and found both to be really helpful. But, I've come across a problem ... How do you draw the array on-screen? In your source, you've used:
 1 `levels[currentLevel].draw(g);`

Which doesn't seem to work for me  I've made the arrays, and I've assigned the numbers to Images, but that bit doesn't seem to work and I don't know what else to use.

Thanks!
 16 Game Development / Newbie & Debugging Questions / TILES. on: 2012-07-31 21:16:37 I'd really love to make a 2d top-down tile-based game, similar to Legends of Yore (http://www.legendsofyore.com/) in that you move one square at a time. Unfortunately, I have no idea where to start  I've made a few really basic things using Slick2D, but when I've tried to Google where to start with tile-based games, I've not been able to find anything D: So, what I'm asking is, could you help me out with starting to program a tile-based game?Thanks!
 Pages: [1]
 DesertCoockie (54 views) 2018-05-13 18:23:11 nelsongames (86 views) 2018-04-24 18:15:36 nelsongames (76 views) 2018-04-24 18:14:32 ivj94 (761 views) 2018-03-24 14:47:39 ivj94 (93 views) 2018-03-24 14:46:31 ivj94 (645 views) 2018-03-24 14:43:53 Solater (106 views) 2018-03-17 05:04:08 nelsongames (187 views) 2018-03-05 17:56:34 Gornova (428 views) 2018-03-02 22:15:33 buddyBro (1088 views) 2018-02-28 16:59:18
 Java Gaming Resourcesby philfrei2017-12-05 19:38:37Java Gaming Resourcesby philfrei2017-12-05 19:37:39Java Gaming Resourcesby philfrei2017-12-05 19:36:10Java Gaming Resourcesby philfrei2017-12-05 19:33:10List of Learning Resourcesby elect2017-03-13 14:05:44List of Learning Resourcesby elect2017-03-13 14:04:45SF/X Librariesby philfrei2017-03-02 08:45:19SF/X Librariesby philfrei2017-03-02 08:44:05
 java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org