Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  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 Tongue 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 Clueless I may just stick to playing other peoples' games haha Tongue
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 Tongue 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 Tongue
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  Sad
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 Smiley

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  Clueless

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 Sad 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  Clueless
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  persecutioncomplex
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-Canyon

But, 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/3038e0e8a2e

Thanks!
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  Sad 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  Clueless

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]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (28 views)
2014-09-12 09:08:26

Norakomi (57 views)
2014-09-10 13:57:51

TehJavaDev (72 views)
2014-09-10 06:39:09

Tekkerue (37 views)
2014-09-09 02:24:56

mitcheeb (57 views)
2014-09-08 06:06:29

BurntPizza (43 views)
2014-09-07 01:13:42

Longarmx (27 views)
2014-09-07 01:12:14

Longarmx (34 views)
2014-09-07 01:11:22

Longarmx (34 views)
2014-09-07 01:10:19

mitcheeb (40 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!