Hi !
Featured games (87)
games approved by the League of Dukes
Games in Showcase (672)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (727)
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  Java Game APIs & Engines / Tools Discussion / Doing a mix of 3d and 2d on: 2010-06-13 17:34:33
Currently myself and a friend are developing both a game design document and a class diagram for an online rpg that will run in applet. We are mainly aiming at a 2d game with an isometric view angle. For the ground/terrain, we don't want it to look flat and boring, but more or less actually have hills and such. I know a lot can be done with shading and proper drawing to show depth and slopes. Im wondering if perhaps using a 3d mesh is the way to go, and we can just do some simple 2d sprites that run over top. Is this a bad idea?

If we go down that route, I'm thinking using the lwjgl is probably the way to go. JME2 would be nice, but I think since it's primary focus is full 3d, that might not work so well. I do like slick as well, but obviously that wouldnt support the 3d terrain.

Any thoughts or suggestions on that methodology, and the tools we're thinking of?
2  Game Development / Game Play & Game Design / Re: Tile an image across a given x,y,height,width - slick2d on: 2010-06-10 22:46:37
Was working on it a bit last night, and I found that since the texture coords took the image and stretched it across, I ended up with the same problem. So i put together a method to essentially tile it, but I don't feel like it's very efficient or perfect.
for(int i = 0; i < levels.size(); i++) {
         ArrayList<Sprite> tempGrounds = levels.get(i).getGrounds();
         for(int g = 0; g < tempGrounds.size(); g++) {
            Sprite ground = tempGrounds.get(g);
            Image groundGraphic = ground.getGraphic();
            int gWidth = groundGraphic.getWidth();
            int gHeight = groundGraphic.getHeight();
            int xTimes = (int)ground.getSizeX() / gWidth;
            int yTimes = (int)ground.getSizeY() / gHeight;
            if(xTimes <= 0) {
               xTimes = 1;
            if(yTimes <= 0) {
               yTimes = 1;
            for(int x = 0; x < xTimes; x++) {
               for(int y = 0; y < yTimes; y++) {
                  groundGraphic.draw(ground.getX() + (gWidth * x), ground.getY() + (gHeight * y), gWidth, gHeight);

Due to the fact im dividing intergers, I know there will be a loss of accuracy, and therefore rendered images will actually be in some cases shorter than the actual block. I think this has a bigger problem of leading to a lot of computation when more and more gets added as a process.
3  Game Development / Game Play & Game Design / Re: Tile an image across a given x,y,height,width - slick2d on: 2010-06-09 23:56:40
Thanks a lot, that really gave me a clear picture of how the textcoords work. It's still not perfect. I may want to modify my image so it has the sprites in the quadrants evenly. Make it more of a spritesheet.
4  Game Development / Game Play & Game Design / Re: Tile an image across a given x,y,height,width - slick2d on: 2010-06-09 22:29:21
Hmm, think i might crack open my book on opengl and read a bit about texture mapping, as this is starting to go over my head. I have tried messing around with the values. With 0,3 i see the image tiled 3 times across the rectangular area. Switching it to 0, 1 has it once. Now if i switch it to 0.5f, 1, I just see the character image once, not the one for my ground at all. This image just has a stickman, and then to the right of it, the ground.
5  Game Development / Game Play & Game Design / Tile an image across a given x,y,height,width - slick2d on: 2010-06-09 02:23:11
Been trying to figure this out. I have an ArrayList of my own Sprite class. The sprite class simply contains x, y, width, height, and a type Image from Slick. In my gameplaystate, I loop through the arraylist that contains all the ground sprites. I just have one in there for now. To pull in my ground image, i have it in the same .png as my player sprite. I just use the getSubImage() method to separate it. The problem is, when im using GL11 code to tile out the image, it has both the ground and character images in the tile, even though im referring to the subbed image. I might just be using it wrong, or perhaps there's a better way with slick methods to accomplish this. Here's my loop to draw out the ground objects:

public void drawSurfaces() {
      for(int i = 0; i < levels.size(); i++) {
         ArrayList<Sprite> tempGrounds = levels.get(i).getGrounds();
         for(int g = 0; g < tempGrounds.size(); g++) {
            Sprite ground = tempGrounds.get(g);
            // ground.getGraphic().draw(ground.getX(), ground.getY(), ground.getSizeX(), ground.getSizeY());
            float x = ground.getX();
            float y = ground.getY();
            float rightX = ground.getRightX();
            float bottomY = ground.getBottomY();
            // draw the pattern
            GL11.glTexCoord2f(0, 0);
            GL11.glVertex2f(x, y);
            GL11.glTexCoord2f(3, 0);
            GL11.glVertex2f(rightX, y);
            GL11.glTexCoord2f(3, 3);
            GL11.glVertex2f(rightX, bottomY);
            GL11.glTexCoord2f(0, 3);
            GL11.glVertex2f(x, bottomY);

ground.getGraphic().draw(ground.getX(), ground.getY(), ground.getSizeX(), ground.getSizeY()); will draw out the correct image, but it stretches it. While my current ground image is just a single colour, learning to tile now will be better. Plus the stretched image doesn't look as good.
6  Java Game APIs & Engines / Tools Discussion / Re: having issues with slick2d AngelCodeFont on: 2010-06-04 20:55:38
Ahhhh. Yeah i see i have several png files in the resources folder. Do I need to include them all or something to have access to all the characters I require?

Just had to clear the glyph cache. I'm good Smiley.
7  Java Game APIs & Engines / Tools Discussion / Re: having issues with slick2d AngelCodeFont on: 2010-06-03 11:21:37
The clarify, the words Next and Score are part of the image used for the backround. That polygon of light gray in the score box is supposed to be a number. I'll review my font file as well as you suggested, I don't think I selected any effects, but there may be some by default or something.
8  Java Game APIs & Engines / Tools Discussion / having issues with slick2d AngelCodeFont on: 2010-06-02 23:59:35
I followed the on the slick website to create a tetris clone. The code was a bit off and needed some adjustments. To render the players score, it uses the TrueTypeFont class, which is now depricated. After google searching, I found a suggestion to use the AngelCodeFont, and to create a font file using a tool called Hiero. I created the file, and setup the code, however my text seems to render quite funny or not at all. By funny, I mean it almost looks as if it's too big, and is cut off for where i placed it. I used 12px Arial font, and no luck. Here's a screen of what I am experiencing:

Any suggestions? Here's how im using the AngelCodeFont class:
public void init(GameContainer gc, StateBasedGame sbg)
         throws SlickException {
/* other code */
      font = new AngelCodeFont("resources/Arial10.fnt", gameHUD);
/* more code */

public void render(GameContainer gc, StateBasedGame sbg, Graphics g)
      throws SlickException {
/* other code */
           font.drawString(600, 80, String.valueOf(score));
Pages: [1]
IanParcs (48 views)
2016-04-18 13:18:53

KaiHH (46 views)
2016-04-18 07:35:41

KaiHH (76 views)
2016-04-15 11:43:58

theagentd (79 views)
2016-04-14 01:16:17

theagentd (94 views)
2016-04-14 01:15:43

IanParcs (106 views)
2016-04-12 02:51:16

IanParcs (48 views)
2016-04-12 02:50:03

IanParcs (44 views)
2016-04-12 02:49:54

IanParcs (39 views)
2016-04-12 02:49:52

IanParcs (49 views)
2016-04-12 02:49:52
Website offering 3D Models specifically for games for free
by vusman
2016-04-29 11:56:17

List of Learning Resources
by SilverTiger
2016-02-05 08:39:47

List of Learning Resources
by SilverTiger
2016-02-05 08:38:38

List of Learning Resources
by SilverTiger
2016-02-05 08:35:50

Rendering resources
by Roquen
2015-11-13 13:37:59

Rendering resources
by Roquen
2015-11-13 13:36:58

Math: Resources
by Roquen
2015-10-22 06:46:10

Networking Resources
by Roquen
2015-10-16 06:12:30 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‑
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!