[Suggestion] Brick particles from broken brick blocks.

General Mar0 discussion has been moved to this subforum!
Post Reply
User avatar
Superjustinbros
Posts: 2119
Joined: 29 Mar 2012, 20:39
Contact:

Post » 17 Jun 2012, 01:26

This isn't that much of a problem, but you know how when you break a brick block the small bricks that fly out? Well I was thinking since the editor's mini map can draw the colors of a solid tile, I was thinking the brick block particles that shoot out could match the color of the placed brick/destroyable block, rather than the brick block pieces being one color.

User avatar
RWLabs
Posts: 796
Joined: 05 Feb 2012, 03:36
Contact:

Post » 17 Jun 2012, 01:34

I just read the title and already +1.

Franpa
Posts: 409
Joined: 08 Mar 2012, 07:20
Contact:

Post » 17 Jun 2012, 04:37

RWLabs wrote:I just read the title and already +1.
I just read the title that doesn't explain the idea and oh my god I'm just so excited! I have to +1 the idea regardless of what the idea is!

User avatar
TurretBot
Posts: 4412
Joined: 15 Mar 2012, 23:18
Contact:

Post » 17 Jun 2012, 22:31

Franpa wrote:
RWLabs wrote:I just read the title and already +1.
I just read the title that doesn't explain the idea and oh my god I'm just so excited! I have to +1 the idea regardless of what the idea is!
Yes Indeedee!
+99999999999999999999999999999999999999999999999999999999999999999

User avatar
popcan12
Posts: 592
Joined: 10 Feb 2012, 02:30

Post » 18 Jun 2012, 00:30

It's called you need to change the spriteset or something of that sort.

User avatar
Superjustinbros
Posts: 2119
Joined: 29 Mar 2012, 20:39
Contact:

Post » 18 Jun 2012, 00:47

popcan12 wrote:It's called you need to change the spriteset or something of that sort.
It's still only one color.

User avatar
RWLabs
Posts: 796
Joined: 05 Feb 2012, 03:36
Contact:

Post » 18 Jun 2012, 00:57

popcan12 wrote:It's called you need to change the spriteset or something of that sort.
If you do that every block will break into that specific spriteset, pretty much defeating the purpose of this.

User avatar
popcan12
Posts: 592
Joined: 10 Feb 2012, 02:30

Post » 18 Jun 2012, 02:31

Image
Well, here's the reason that won't work. You would need to make more of these. This is the block debris.

Edit: Oh, and something like this could probbaly be easy to make into a mod, if you know how to code...

User avatar
RWLabs
Posts: 796
Joined: 05 Feb 2012, 03:36
Contact:

Post » 18 Jun 2012, 03:16

popcan12 wrote:Image
Well, here's the reason that won't work. You would need to make more of these. This is the block debris.

Edit: Oh, and something like this could probbaly be easy to make into a mod, if you know how to code...
Yes, the only way to do this is to mod it. We could pull it off, but we would need
Image
this graphic for every single breakable block. Even if we mod if right so that it doesn't need that graphic, it's still a mod. This would be a cool feature in the real game.

Franpa
Posts: 409
Joined: 08 Mar 2012, 07:20
Contact:

Post » 18 Jun 2012, 03:26

popcan12 wrote:Image
Well, here's the reason that won't work. You would need to make more of these. This is the block debris.
I think the bigger problem is that you'd need to mod in the ability to configure which breakable bricks will appear when the bricks are broken, currently this is controlled on a level by level basis and not brick by brick basis.

User avatar
Mr.Q.Marx?
Posts: 849
Joined: 15 May 2012, 18:35

Post » 18 Jun 2012, 14:55

The minimap code seems to start on line 144 in 'editor.lua' though I can't work out how it does the pixel representations.
Here are two different versions. Made white so they can be easily recoloured in-game. Like Mario's body is. The top one has the shadows from the bricks intact whereas the bottom one has had those removed. This should make for wider use but is less detailed in style.
Image
EDIT: most of the drawing of it seems to be from 366. My mistake.

Code: Select all

local id = lmap[x][y][1]
						if id ~= nil and id ~= 0 and tilequads[id].invisible == false then
							if rgblist[id] then
								love.graphics.setColor(unpack(rgblist[id]))
								love.graphics.rectangle("fill", (minimapx+x*2-minimapscroll*2)*scale, (minimapy+y*2)*scale, 2*scale, 2*scale)
							end
						end
I think that's the minimap tile colour code.

pbalazs
Posts: 105
Joined: 27 Apr 2012, 23:33

Post » 19 Jun 2012, 18:30

Normally when a map is loaded, the rgblist table is filled with the average rgb color for each tile on the level. You have to modify the blockdebris class to accept a color as an argument, then make the destroyblock function in mario.lua pass the tile color to the blockdebris.

I've made it for you:
Replace blockdebris.lua file with this one https://dl.dropbox.com/u/5831485/m/blockdebris.lua
Then add these to mario.lua, to the function destroyblock(), place it just before the line map[x][y][1] = 1

Code: Select all

	-- get tile color
	local id = map[x][y][1]
	local color = false
	if id ~= nil and id ~= 0 and tilequads[id].invisible == false then
		if rgblist[id] then
			color = rgblist[id]
		end
	end
and change

Code: Select all

	table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, 3.5, -23))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, -3.5, -23))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, 3.5, -14))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, -3.5, -14))
to

Code: Select all

	table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, 3.5, -23, color))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, -3.5, -23, color))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, 3.5, -14, color))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, -3.5, -14, color))
Now when a color is passed, the blockdebris will use the third spriteset, the gray one, cause that can be colored quite well. Replace that one if you want it to be more colored.

User avatar
Mr.Q.Marx?
Posts: 849
Joined: 15 May 2012, 18:35

Post » 20 Jun 2012, 18:46

pbalazs wrote:change

Code: Select all

	table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, 3.5, -23))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, -3.5, -23))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, 3.5, -14))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, -3.5, -14))
to

Code: Select all

	table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, 3.5, -23, color))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, -3.5, -23, color))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, 3.5, -14, color))
		table.insert(blockdebristable, blockdebris:new(x-.5, y-.5, -3.5, -14, color))
This works PERFECTLY. Also if you have Mari0 eXTended, remove the 'else' statement around that and the 'if' from the one before and it'll make the right colours there too.

pbalazs
Posts: 105
Joined: 27 Apr 2012, 23:33

Post » 20 Jun 2012, 19:46

I'll include this in the next version of the eXTended mod.

FaycalMenouar
Posts: 1069
Joined: 11 May 2012, 18:00

Post » 22 Jun 2012, 19:07

i don't even understand the idea , brick particles already matches the blocks , you only have to change the spriteset from overworld to underground or whatever ,

pbalazs
Posts: 105
Joined: 27 Apr 2012, 23:33

Post » 22 Jun 2012, 20:59

FaycalMenouar wrote:i don't even understand the idea , brick particles already matches the blocks , you only have to change the spriteset from overworld to underground or whatever ,
With the mod, the bricks flying out of a destroyed tile will be the same color as the tile, using the getaveragecolor function which is used in the level editor minimap.

User avatar
TurretBot
Posts: 4412
Joined: 15 Mar 2012, 23:18
Contact:

Post » 23 Jun 2012, 00:19

Screenies?

Franpa
Posts: 409
Joined: 08 Mar 2012, 07:20
Contact:

Post » 23 Jun 2012, 06:49

pbalazs wrote:
FaycalMenouar wrote:i don't even understand the idea , brick particles already matches the blocks , you only have to change the spriteset from overworld to underground or whatever ,
With the mod, the bricks flying out of a destroyed tile will be the same color as the tile, using the getaveragecolor function which is used in the level editor minimap.
To further explain: Basically instead of being limited to 2 or 3 breakable brick colours, we're able to use whatever colours we want!

FaycalMenouar
Posts: 1069
Joined: 11 May 2012, 18:00

Post » 23 Jun 2012, 10:08

Franpa wrote:To further explain: Basically instead of being limited to 2 or 3 breakable brick colours, we're able to use whatever colours we want!
Hell yeah . ! good idea

edit: yeah sorry for bumping but is Maurice aware of this ? it should be in SE .

User avatar
Superjustinbros
Posts: 2119
Joined: 29 Mar 2012, 20:39
Contact:

Post » 30 Jan 2013, 02:13

Sorry for the extreme bump, but could some one be able to mod my SJB mod so the Used Blocks that are created from Brick Blocks use the color of said Brick Block?

User avatar
BobTheLawyer
Posts: 2232
Joined: 01 May 2012, 21:00

Post » 30 Jan 2013, 02:23

Superjustinbros wrote:Sorry for the extreme bump, but could some one be able to mod my SJB mod so the Used Blocks that are created from Brick Blocks use the color of said Brick Block?
pbalazs wrote:Replace blockdebris.lua file with this one https://dl.dropbox.com/u/5831485/m/blockdebris.lua

User avatar
Superjustinbros
Posts: 2119
Joined: 29 Mar 2012, 20:39
Contact:

Post » 30 Jan 2013, 02:53

Nothing happened. Everything's still the same.

What I'd like is for when the player hits a breakable block with an item entity placed on it and removes all it's contents, the Used Block that sprouts from the breakable block (not ? blocks or invisible blocks) is always defaulted to the grey Used Block on the SMB tileset (Row 5, Column 2) regardless of which theme the current room is set to, where said Used block is colorized based on the overall color set by the original tile, just like how the brick debris is given it's custom color based on what tile was destroyed.

Post Reply