Author Topic: Tile based map using canvas  (Read 1631 times)

Offline jannesiera

  • Level 35
  • **
  • Posts: 1,026
  • Reputation: +6/-1
    • View Profile
    • BBGameDesign
Tile based map using canvas
« on: August 28, 2009, 08:14:47 AM »
I'm experimenting with the canvas element to create a tile based map. Right now it's still a small and not very useful script, but please take a look at it.

So if you have any suggestions, or the script can be useful to you, feel free to comment / use the script.

Offline jannesiera

  • Level 35
  • **
  • Posts: 1,026
  • Reputation: +6/-1
    • View Profile
    • BBGameDesign
Re: Tile based map using canvas
« Reply #1 on: August 28, 2009, 01:46:44 PM »
I have a question. Does anyone have a good idea to go about terrain transitions ?

There's a good article about it here: http://www.gamedev.net/reference/articles/article934.asp

But if someone has another way I'd love to hear it. Also, although it doesn't look that hard, I don't fully understand what he's saying in the article. So if it's explained differently, or something, that would also be helpful.

Offline jannesiera

  • Level 35
  • **
  • Posts: 1,026
  • Reputation: +6/-1
    • View Profile
    • BBGameDesign
Re: Tile based map using canvas
« Reply #2 on: August 29, 2009, 07:10:35 AM »
It was a nice experiment, but I'm afraid that a tile based map with canvas would really be a pain. Because clickable areas are a pain...

So if anyone is curious for a map with canvas, I suggest you just go with a more 'standard' method.

Offline Fizzadar

  • Level 8
  • *
  • Posts: 39
  • Reputation: +0/-0
  • Rawr!
    • View Profile
    • Fanatical Dev
Re: Tile based map using canvas
« Reply #3 on: September 02, 2009, 11:13:11 AM »
For my maps I just use a series of div's each a certain width and height, and float them alongside each other. The actual map is simply one background image, but could be easily made up of blocks, so you could have a "live" map editor, but photoshop does that anway...
~Fizzadar

Offline jannesiera

  • Level 35
  • **
  • Posts: 1,026
  • Reputation: +6/-1
    • View Profile
    • BBGameDesign
Re: Tile based map using canvas
« Reply #4 on: September 04, 2009, 04:56:58 PM »
Now I know a little bit more about image maps I know clickable areas are possible. You need to put a transparent image on top of the canvas element, and create an image map. That's it.

Offline raines80

  • Level 8
  • *
  • Posts: 44
  • Reputation: +1/-1
    • View Profile
Re: Tile based map using canvas
« Reply #5 on: September 24, 2009, 09:14:07 AM »
Clickable maps using tiles is time consuming, but can be accomplished.... my question on this is thus...


Is there a way to do a tile based map while having an indepent charcter that would react to the canvas (ie; mountains, holes, whatever....)?  The reason I ask is because I have developed a couple of maps for navigation within my game, but I would like to have my character on the map move to the nav points and not have him floating above the canvas....

Offline jannesiera

  • Level 35
  • **
  • Posts: 1,026
  • Reputation: +6/-1
    • View Profile
    • BBGameDesign
Re: Tile based map using canvas
« Reply #6 on: September 25, 2009, 09:47:30 AM »
Check out this: Game Development with JavaScript and the Canvas element

That may help to see the potential of the canvas element.

Offline jannesiera

  • Level 35
  • **
  • Posts: 1,026
  • Reputation: +6/-1
    • View Profile
    • BBGameDesign
Re: Tile based map using canvas
« Reply #7 on: March 05, 2010, 05:37:42 PM »
I have a new blogpost up over at BBGameDesign with a very basic game map script (but more advanced than the previous snippet). There's even a hand drawn programmer art tile set to go with it and an actual demo :). Nothing difficult but it might help some newer programmers.

http://www.bbgamedesign.com/pbbg-community/basic-game-map

Offline raestlyn

  • Level 29
  • **
  • Posts: 463
  • Reputation: +9/-5
    • View Profile
Re: Tile based map using canvas
« Reply #8 on: March 05, 2010, 09:08:44 PM »
Sorry Janne, but it doesn't work for me in FF, in IE or in Chrome.


I can send you pics of my cocks if you want reference.


Offline jannesiera

  • Level 35
  • **
  • Posts: 1,026
  • Reputation: +6/-1
    • View Profile
    • BBGameDesign
Re: Tile based map using canvas
« Reply #9 on: March 06, 2010, 03:55:55 AM »
Sorry Janne, but it doesn't work for me in FF, in IE or in Chrome.

I needed to update a link somewhere, I'm sorry, but it works now :D.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal