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
⌛
This post has been reserved for your question.
Hey @Pong! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
you could use the alphabet
yea you could use characters
and to compare them just cast to int etc
i tried, it didnty work
should prob look like this then
title= new ArrayList<Char>();
title['a'] = ...
Can't you just use numbers over 9?
Like
120 4 10 8
1 2 5 12
he can
he thought if he put 11 and moved to that tile it would say 1
💤
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.
Nah, that doesn’t work either
I tried
Could you explain why it wont work?
And what exactly do you aim to achieve?
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
i dont know the reason it didnt work
but
when i use single dig numbers it works, being able to load the texture on the world map
symbols dont work
neither do letters
💤
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.