Results 1 to 3 of 3
  1. #1
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    176
    Rep Power
    1

    Default 2D Game, How could I create a library of tiles?

    So I'd like to make like a library of tiles, and it isn't too big, which I could just call using a method, and I would specificy what information I need to get, and it would return that information.

    For example, a small section of the tiles library is grass_tile, I call this library and specify what I need, and in this case let's say I need the width, or can the character enter it from north? or can the character just stand on it? So it's like a library or array, with sections of it being named by tiles, and by mentioning these tiles I can information about them.

    Very crude example, not even sure if it's possible in java:
    gTile("grass","walkon") will return true, first because I specifiy grass, and yes the character can walk on grass, so it returns a boolean value of true.
    gTile("stone","width") will return 16, first because I specify stone, and the stone's png image size is 16.

    What I'm asking is not for how to work out if the character can walk on the tile, or read the width of a tile, but can I create like a library from which I can obtain information by giving the name of the tile, and then telling it what info I need. If you need to know what I'd like to use this for _,

    If up key pressed && gTile((yTILE + 1).name(),"walkon") == true then moveChar("up")
    NOTE: This example is very crude, and is just a description of what I need.

  2. #2
    augustas656 is offline Senior Member
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    176
    Rep Power
    1

    Default Re: 2D Game, How could I create a library of tiles?

    Lol, WHAT THE... I translated that it literally different paragraphs saying completely different topics, and it's like your bloody biography. Why, what?

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,762
    Blog Entries
    7
    Rep Power
    21

    Default Re: 2D Game, How could I create a library of tiles?

    Quote Originally Posted by augustas656 View Post
    Lol, WHAT THE... I translated that it literally different paragraphs saying completely different topics, and it's like your bloody biography. Why, what?
    I removed all of that spammer's posts and threads, banned the spammer forever and reported him for the anti-spammer database; in short: the spammer went through the rotating knives machine and he is no more; he is an ex-spammer; gone to meet his maker; joined the choir invisible; he's a stiff.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 2
    Last Post: 03-03-2014, 07:48 PM
  2. Replies: 2
    Last Post: 05-09-2013, 06:37 PM
  3. Lightweight Java Game Library?
    By gogonimago in forum Java Gaming
    Replies: 1
    Last Post: 03-20-2012, 06:31 AM
  4. How to create a directory using the library java.io
    By bachtoutou in forum New To Java
    Replies: 3
    Last Post: 05-23-2008, 11:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •