In my game Dungeoneer I have a tile-based terrain generator.
How could I go about making these tiles destructible? I just want to be able to click on a tile to "delete" it.
EDIT: .love removed, U'm restarting the game.
help no longer needed
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
help no longer needed
Last edited by LaserGuns on Tue Jul 17, 2012 5:06 am, edited 2 times in total.
Re: Destructible tiles? Help
I would store another piece of information with where you are keeping the image for your file that would represent whether or not the tile is destructible. Have the mouse check that info when you click on the portion of the map where you've drawn the image.
I'd probably be able to offer a less vague answer with the .love present - sorry!
I'd probably be able to offer a less vague answer with the .love present - sorry!
Re: Destructible tiles? Help
You did awesome well. We community should be punished for being slow answering at your stuff. Please next time also post the time limit you willing to wait. You should trust no one because your code is probably too precious and too advanced to be handled to us. "sigh"LaserGuns wrote:EDIT: .love removed, no replies
About your problem itself it's more lack of LOVE/Lua principles/basics knowledge, lack of willing to learn by yourself or lazyness in search forum. The time you got bored waiting, some other beginner coder would learn how to do it searching forum or checking wiki (or learning a bit more Lua).
Since attachment (here and in your original thread) gone I can't directly help in your code, so can you at least manage to learn watching a similar basic engine?
Well, see this very basic example from here viewtopic.php?f=4&t=5764&p=43677#p43687 (kudos to authors!) that I altered quickly to be able to delete too with right-click.
Also have a chance to watch how blocks are kept in this engine. Notice that is map[x][y] oriented so it's easier to process and print blocks instead of your block[number] = X,Y style with the inconveniences that I discussed in original dungeoneers thread.
This is the (clumsy altered) magic part for you that get mouse postion, translate to x,y map coordinates (with your system you will have to badly sweep all block till it find it), check if left or right button mouse was clicked and do respective thing (assign or delete a block) to that map position:
Code: Select all
function love.mousepressed(x, y, key)
x, y = love.mouse.getPosition()
block_x = math.ceil(x / size)
block_y = math.ceil(y / size)
if key == "l" then
blockdata[block_y][block_x] = selectX
end
if key == "r" then
blockdata[block_y][block_x] = 0 -- alter 0 to whatever your empty tile is. could be other stuff but how can I know without the attachment?
end
...
end
Last edited by coffee on Wed Jul 11, 2012 1:54 pm, edited 1 time in total.
Re: Destructible tiles? Help
What? How is removing the .love "punishing" the community? I took it down because I'm restarting the game (because of your recommendation) and I don't want people to waste their time.coffee wrote:You did awesome well. We community should be punished for being slow answering at your stuff. Please next time also post the time limit you willing to wait. You should trust no one because your code is probably too precious and too advanced to be handled to us. "sigh"LaserGuns wrote:EDIT: .love removed, no replies
About your problem itself it's more lack of LOVE/Lua principles/basics knowledge, lack of willing to learn by yourself or lazyness in search forum. The time you got bored waiting, some other beginner coder would learn how to do it searching forum or checking wiki (or learning a bit more Lua).
Since attachment (here and in your original thread) gone I can't directly help in your code, so can you at least manage to learn watching a similar basic engine?
Well, see this very basic example from here viewtopic.php?f=4&t=5764&p=43677#p43687 (kudos to authors!) that I altered quickly to be able to delete too with right-click.
Also have a chance to watch how blocks are kept in this engine. Notice that is map[x][y] oriented so it's easier to process and print blocks instead of your block[number] = X,Y style with the inconveniences that I discussed in original dungeoneers thread.
This is the (clumsy altered) magic part for you that get mouse postion, translate to x,y map coordinates (with your system you will have to badly sweep all block till it find it), check if left or right button mouse was clicked and do respective thing (assign or delete a block) to that map position:Code: Select all
function love.mousepressed(x, y, key) x, y = love.mouse.getPosition() block_x = math.ceil(x / size) block_y = math.ceil(y / size) if key == "l" then blockdata[block_y][block_x] = selectX end if key == "r" then blockdata[block_y][block_x] = 0 -- alter 0 to whatever your empty tile is. could be other stuff but how can I know without the attachment? end ... end
Edit: I didn't realize it when I first read your post, but you are a pompous dick. Please don't reply to my topics anymore unless you have something constructive to say. You've told me plenty of times that my block system (on my first freaking project) is bad, I get it. And the wiki is rather vague sometimes.
Re: Destructible tiles? Help
Well I wasn't to reply but I notice your later "Edit" where you screwed again with a sad edit. Because in your original reply I thought "just leave it, there is no reason for wasting time. Move along. One day (if he wasn't be malicious now) he will understand for sure how to do in this "I don't need after all anymore help" situations.".LaserGuns wrote: What? How is removing the .love "punishing" the community? I took it down because I'm restarting the game (because of your recommendation) and I don't want people to waste their time.
Edit: I didn't realize it when I first read your post, but you are a pompous dick. Please don't reply to my topics anymore unless you have something constructive to say. You've told me plenty of times that my block system (on my first freaking project) is bad, I get it. And the wiki is rather vague sometimes.
Well, if you really didn't want that we waste our time with you next time should properly "close" a thread because you did it terribly. But you didn't even reply/edited with a "sorry, I figure out or I don't need that you reply anymore.
You just removed your attachment, putted there "EDIT: .love removed, no replies" (that sorry isn't really the same that the now edited "I'm restarting game". Seems a bit more of someone that you removed because got pissed that no one helped). However you still left all the text that leads people to response and help you. Because you still left (and yes is still there):
You left even the title:In my game Dungeoneer I have a tile-based terrain generator. How could I go about making these tiles destructible? I just want to be able to click on a tile to "delete" it.
Sorry, but for me and everyone else that is STILL continue asking for help. Crimson noticed the help request, helped a bit but didn't helped more because noticed you removed the always helpful attachment. I notice too your help request but yes I was silly enough I see now to help you.Destructible tiles? Help
Your behavior was like remove the bullet, left all broken things in the floor and still left in the wall blood writen "help me". That's why is a kind of insulting us. You (still) asking for help, give indication that you had there the helpful attachment but now says that isn't more because you don't want it.
I said your system was bad, and explained why is bad and told where solutions where to you could learn how to do it, I pointed to several other similar engines, I helped you even you screw up in this thread . However you even didn't the downloaded till now and checked the solution I assembled to you. Yes you right I was tottally "what you said" for helping you because after all you are even a pompous "whataver you say" than me. Do whatever you want, as I or perhaps anyone else is really worried about how you do it. And the WIKI my dear gives almost you need if people isn't lazy. Even funier is that I worried that was the maps wiki tutorials were so "vague" that I rewrote an engine for you just to do want you wanted! Yes, the one you didn't even downloaded. And now you won't do it. That someone else help you from now on.
And don't worry I won't reply anymore to you (unless you worst it more).
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Destructible tiles? Help
While coffee does have a point, his overall tone and choice of words is not accepted in this community.
LaserGuns, the next time you have a problem I might be able to help you myself, and I look forward to doing so.
Coffee, I would decrease your karma for this if you hadn't disabled it. You really should know better.
LaserGuns, the next time you have a problem I might be able to help you myself, and I look forward to doing so.
Coffee, I would decrease your karma for this if you hadn't disabled it. You really should know better.
Help us help you: attach a .love.
Re: Destructible tiles? Help
Very well, I enabled it just for you. You can discount from my pool even that is a bit sad confess that I will be dekarmad by you.Robin wrote:While coffee does have a point, his overall tone and choice of words is not accepted in this community.
LaserGuns, the next time you have a problem I might be able to help you myself, and I look forward to doing so.
Coffee, I would decrease your karma for this if you hadn't disabled it. You really should know better.
And sorry for my overall tone. Was from one guy that was willing to help, it actually helped laserguns (not here but in several threads) but even that way had was called pompous something for the mistake of someone else.
(However my feeling and attitude about karma will not change. I have deactivated not because I'm afraid of be dekarma but because I don't like use medals. I help for help, not for status)
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 4 guests