Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (711)
Games in Android Showcase (213)
games submitted by our members
Games in WIP (785)
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: Sprite render order using libgx tiled maps on: 2017-02-17 09:07:42
That's something I didn't actually think about, I will check it out. Although there will be on average 100+ entities or map objects to draw and each entity would need to look as though they could be standing in-front of any other entity, wouldn't that have a massive negative impact on performance?

Also when I say maintain the z-order of the tiles I meant that I have 3 layers in the TILED map, 1 for floor tiles, 1 for entity map objects and 1 for bridges so to say. libGDX renders it in the order of the layers to make it appear as though the entities are on the floor yet under the bridge. I should probably of made that part more clear.
2  Game Development / Newbie & Debugging Questions / Sprite render order using libgx tiled maps on: 2017-02-17 08:47:09
Okay, so I am officially stumped,

I am making a 2D top-down game using libGDX. I make my tiled maps using TILED.
Is there a way to order/sort the map objects so they display in the correct z-order on a specific object layer.
All I really need is for the one entity to look like they are standing in front of another entity on the same object layer.

I overrode the BatchTileMapRenderer so that the map object (which I made from another Entity class) are actually displayed when you render the map
public class MapRenderer extends BatchTiledMapRenderer{
    public void renderObject(MapObject object) {
        if(object instanceof Entity) {
            Entity ent = (Entity) object; ent.render();
            batch.draw(ent.sprite, ent.pos.x, ent.pos.y);

This is literaly all there is to it to render the map itself
    public void render(Camera camera){

The reason I want to do it this way is to keep it simple, and to maintain the z-order of tiles,
where if the player walks under a bridge the bridge is displayed above the player.

Any and all help would be welcome... even if to just tell me I'm doing it wrong
Many Thanks.
3  Game Development / Newbie & Debugging Questions / Procedural (never ending) map generation on: 2016-03-17 12:00:15
Hi all,

Pretext: I have minimal experience on this part of game dev and very little time to do research and what not, so I only ask that you all be kind to me in the search for wisdom and knowledge Smiley

Moving on...
I have (briefly) read up on perline noise and diamond square and such, all the normal things you get from simply typing "procedural terrain generation" into google. However non of these strike me as being procedural. What I would think is that procedural means never ending, so you can jump on a map at [0,0] and walk forever north with no limits, no edge of the map. In ALL the examples of procedural generation I see people create a height map for a terrain and leave it at that. I would call that random map generation, not procedural because it has a map edge. This is also not because they used only a snip-it of the map but the source code supplied to generate the map requires a height and width as a parameter.

I would like to know how to do a procedural (never ending) map, that is my goal. To start at [0,0] and generate terrain while the player moves north. There are many games that have done this but no where have I been able to find any resources to help me make a tiny version of what these games do. Taking Minecraft as an example, it generates chunks around the player while the player moves around the map. I have done something similar with little success in that the chunks don't actually fit next to each other.

The closest I have gotten so far is using the chunk idea, by showing only 9 chunks around the player and generating the chunks that the player moves into. The trick now is to make the map cohesive with the chunks next to it. I just have no idea how to do that.

Any pointers, any help, any links, even criticism are all of use,
Thanks all.
4  Game Development / Newbie & Debugging Questions / Re: movement key press on: 2013-10-31 11:01:58
this is how I had it originally, but this allows players to move in diagonal lines... and that is now what I want... I need it to move in only one direction at a time
5  Game Development / Newbie & Debugging Questions / movement key press on: 2013-10-31 09:53:41
Hi all,

My question is how do I make a character move in only the direction of the last arrow key input.

So if you press up the character moves upward and then press left without letting go of the up arrow, the character stops moving up and then moves left instead. I have tried and I presume the solution is incredibly simple but it just doesn't want to reveal itself to me.

Here is the code I currently tried, it works but only in one of the axis, when moving up or down the character will change direction if you press either the left or right keys. However if you start with the left or right keys, then the character doesn't change when you press the up or down.

           if(input.left.isPressed()) mx--;
      else if(input.right.isPressed()) mx++;
      else if(input.up.isPressed()) my--;
      else if(input.down.isPressed()) my++;

I have also tried to make it that when you press one of the arrow keys all the other keys are released and that had the same result as this code, one axis it works and the other it does not.

Sorry if it is difficult to understand the question, my brain is fried from trying to figure this out, the quality of the question could be ruined because of that.
6  Game Development / Newbie & Debugging Questions / Re: Appending Perlin maps on: 2013-10-15 07:51:42
is there an example on how to do this, linear hash border thing?
7  Game Development / Newbie & Debugging Questions / Re: Appending Perlin maps on: 2013-10-15 07:43:52
well I suppose to give the question a but more of a standing point... minecraft generates its terrain in chunks of 16x16 blocks, right.  I am only interested in how they managed that, I doubt they made a massive map and just portioned it off... and I realise they probably use many layers of noise but I only want to know that top piece with the sea beach, land, grass and all that...
8  Game Development / Newbie & Debugging Questions / Re: Appending Perlin maps on: 2013-10-15 07:30:28
yeah I read another article on this site that said perlin noise is often mistaken by value noise... However I really cannot tell the difference... fractal noise, value noise and perlin noise all look the same to me...
9  Game Development / Newbie & Debugging Questions / Appending Perlin maps on: 2013-10-15 06:23:45
Hey everyone, got a bit of a question.

I am using a perlin noise function to generate a map of some form, i don't mean to be vague but I am such a newbie with noise generation that I don't actually know how to explain the question in full...

My perlin noise code comes from this site if it helps any:

My question is, how can I make a tiled noise (i know it's been asked but every one they assume "tiled" means to make it copy paste side by side...) as in I make a map with say 100 width and 100 height... but I want to make another 100x100 map to append to either one of the 4 sides and make it seem as though it was always meant to be a 200x100 map...

sorry if my explanation is not 100% right but hopefully you can help me at least with starting off in the right direction.

Note: I don't want to make 1 tile that just repeats over and over, I want to make tiles that merge with the one next to it, like the left map which has half a lake will have the other half on the right map

hope that's clear enough, thanks everyone anyways oh and also I can't put pictures or code or links because I am using my phone to post this.
10  Game Development / Newbie & Debugging Questions / Game Versioning or Numbering on: 2013-05-07 06:14:41

I've done a bit of searching and I know this might seem like a bit of a dull question but... how do you decide on version numbers? For example using a 3 stage version number (if thats the right way to say it) like X.X.X how do you decide which one do increment?

Thanks for the help,
11  Game Development / Newbie & Debugging Questions / Re: blocks in a tile game on: 2013-05-06 08:10:05
well that didn't work... and then it did work...

I removed "blocks" and just made the sign an entity and now everything is working as I wanted it too. Thanks Zhon for the help.
12  Game Development / Newbie & Debugging Questions / Re: blocks in a tile game on: 2013-05-03 05:47:46
That doesn't sound like a bad idea, I might need to make a blockManager class then to determine which block it is and what action to take when the player uses that block... like it would see that the block is a fence and then it would run a use method to open or close the fence but only change the data on that instance of fence... I'll have to just try and see  Grin thanks for the help I'll let you know if I managed to get it working. I'm trying to keep it as simple as programmably possible.
13  Game Development / Newbie & Debugging Questions / blocks in a tile game on: 2013-05-02 14:27:03
Hi all,

What is the best way of implimenting blocks into a tile oriented game? blocks like fences, sign posts, chairs maybe and generally things that have unique data to each block. for example each sign post has unique text attached to each one. The way I have it implimented now is giving me trouble with the unique block.

I've got it implimented in the same way my tiles are, the tile class initiates all the tiles. Heres a code snippit of what I mean.
FROM Block.class
public class Block{
   private static SpriteSheet spriteSheet = new SpriteSheet("/spriteSheets/block_sheet.png");

   public static Block[] blocks = new Block[256];
   public static Block empty = new blockVoid      (spriteSheet, 0xFF00FF00, 0);
   public static Block fence = new blockFence      (spriteSheet, 0xFFFF0000, 1);
   public static Block sign = new blockSign      (spriteSheet, 0xFF, 2);

this doesn't really allow for individual setup because if you change it there then it changes for all of the objects.

Thanks for the help,
Pages: [1]
Archive (34 views)
2017-02-27 19:41:49

Riven (43 views)
2017-02-27 17:26:59

numerical (417 views)
2017-02-21 07:32:16

numerical (418 views)
2017-02-21 07:31:46

theagentd (533 views)
2017-02-18 13:42:33

theagentd (529 views)
2017-02-18 13:35:16

h.pernpeintner (1693 views)
2017-01-24 22:39:11

h.pernpeintner (1671 views)
2017-01-24 22:38:32

Galdo (2236 views)
2017-01-12 13:44:09

Archive (2180 views)
2017-01-02 05:31:41
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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!