Show Posts
|
|
Pages: [1]
|
|
4
|
Game Development / Newbie & Debugging Questions / Re: Tile-based game help!
|
on: 2012-10-20 16: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++) { 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); } } } player = new Polygon(new float[] { 0, 0, tileWidth, 0, tileWidth, -tileHeight, 0, -tileHeight }); 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-20 01: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)){ map.setTileId(540, 180, 0, 4); map.setTileId(540, 240, 0, 1); } else { map.setTileId(540, 180, 0, 1); 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.
|
|
|
|
|
7
|
Game Development / Newbie & Debugging Questions / Re: Tile-based game help!
|
on: 2012-10-14 22: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)){ map.setTileId(x, y, layerIndex, tileid); map.setTileId(x, y, layerIndex, tileid); } else { map.setTileId(x, y, layerIndex, tileid); map.setTileId(x, y, layerIndex, tileid); } |
How is this supposed to work? Thanks again.
|
|
|
|
|
10
|
Games Center / Featured Games / Re: Overbind
|
on: 2012-10-14 01: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?
|
|
|
|
|
14
|
Game Development / Newbie & Debugging Questions / Tile-based game help!
|
on: 2012-10-13 23: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 03: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 23: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!
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|