• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

102 Neutral

About FatManatee

  • Rank
  1. I have a simple question. What are the correct size for a generic tile? Depend from resolution? For example; I have a canvas 500x500 pixel... the tile, better 16x16px or 32x32? How to decide?
  2. Event in the 2D Tile Map

    True. Thanks all! ..and, tile size? I create tile 32x32. Better 16x16 pixel?
  3. Event in the 2D Tile Map

    Sure, it's simple. ^^ Next question, i create a class Tile and class Item. [CODE] Tile { this.with; this.height; this.item = new item; } Item { this.with; this.height; this.x; this.y; } [/CODE] So, collidable == true if the next position of my character is in the item's area. [b]Example:[/b] The tile represents grass with one rock; the rock is a Item(). [quote] Collidable == true if: Item(x) <= EnityNextPosition(x) < item(x) + item.width && Item(y) <= EnityNextPosition(y) < item(y) + item.height [/quote] This is my general idea for manage all events. The question is: is a good idea? Or exist better solutions? I'm afraid of wasting a lot of ram! I'm at work too, sorry for my bad post. XD
  4. Hi, i'm a beginner and i try to build a 2D Game using <canvas> element and JavaScript. I create a map and a character.. now, i use the keyboard to move a character in the map, but i have many question. What is the theory for collisions and event? I build a map so: [CODE] var map = { [0, 0, 0], [0, 1, 1], [0, 0, 1] } [/CODE] For example, 0 is water, and 1 is grass. My class render the canvas with this matrix, associating the values with the images. The problem is: my character, walking in the water! Should I create a new matrix? For example: [CODE] var map = { [{0, event}, {0, event}, {0, event}], [{0, event}, {1, event}, {1, event}], [{0, event}, {0, event}, {1, event}] } [/CODE] ...is the correct way? I don't find any tutorial for solve this problem! Thanks ^^
  5. *EDIT: sorry, wrong section.
  • Advertisement