Page 1 of 1

help no longer needed

Posted: Sat Jul 07, 2012 5:29 am
by LaserGuns
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.

Re: Destructible tiles? Help

Posted: Mon Jul 09, 2012 6:28 am
by Crimson
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!

Re: Destructible tiles? Help

Posted: Mon Jul 09, 2012 7:29 am
by coffee
LaserGuns wrote:EDIT: .love removed, no replies
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"

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
notdownloadyet.png
notdownloadyet.png (11.06 KiB) Viewed 2247 times
EDITED: Attachment remove because obvious laserguns didn't wan't (he didn't even download it) or really deserve my help.

Re: Destructible tiles? Help

Posted: Mon Jul 09, 2012 5:37 pm
by LaserGuns
coffee wrote:
LaserGuns wrote:EDIT: .love removed, no replies
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"

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
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.

Re: Destructible tiles? Help

Posted: Wed Jul 11, 2012 2:02 pm
by coffee
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 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.".

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):
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.
You left even the title:
Destructible tiles? Help
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.

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).

Re: Destructible tiles? Help

Posted: Wed Jul 11, 2012 3:42 pm
by Robin
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.

Re: Destructible tiles? Help

Posted: Wed Jul 11, 2012 4:29 pm
by coffee
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.
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.
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)