Tiles in a 2d Java game

In working on making a simple tile-based 2d game and I was just wondering about something. Say I have a setup like so; 0 1 2 3 4 5 6 7 8 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 = grass 1 = water 2 = spruce And so on Is there anyway to have more than 9 different types of tiles in a world map? If so I would love to know
18 Replies
JavaBot
JavaBot3d ago
This post has been reserved for your question.
Hey @Pong! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
LinusHuck
LinusHuck3d ago
you could use the alphabet
ayylmao123xdd
ayylmao123xdd3d ago
yea you could use characters and to compare them just cast to int etc
Pong
PongOP3d ago
i tried, it didnty work
Pong
PongOP3d ago
No description
LinusHuck
LinusHuck3d ago
should prob look like this then title= new ArrayList<Char>(); title['a'] = ...
ENDERFUN
ENDERFUN3d ago
Can't you just use numbers over 9? Like 120 4 10 8 1 2 5 12
ayylmao123xdd
ayylmao123xdd3d ago
he can he thought if he put 11 and moved to that tile it would say 1
JavaBot
JavaBot3d ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Pong
PongOP2d ago
Nah, that doesn’t work either I tried
ENDERFUN
ENDERFUN2d ago
Could you explain why it wont work? And what exactly do you aim to achieve?
Pong
PongOP2d ago
so ive got this jframe, you see the trees and stuff, im able to have 9 different types of tiles, so the grass is one of them the tree is one of them the water is one of them and the sorta carpet thing is one of em. what i aim to achieve is to be able to have more variety in my tiles
No description
Pong
PongOP2d ago
i dont know the reason it didnt work but
Pong
PongOP2d ago
when i use single dig numbers it works, being able to load the texture on the world map
No description
Pong
PongOP2d ago
No description
Pong
PongOP2d ago
symbols dont work
No description
Pong
PongOP2d ago
neither do letters
JavaBot
JavaBot2d ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?