[Suggestion] Brick particles from broken brick blocks.
- Superjustinbros
- Posts: 2119
- Joined: 29 Mar 2012, 20:39
- Contact:
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.
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!RWLabs wrote:I just read the title and already +1.
Yes Indeedee!Franpa wrote: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!RWLabs wrote:I just read the title and already +1.
+99999999999999999999999999999999999999999999999999999999999999999
- Superjustinbros
- Posts: 2119
- Joined: 29 Mar 2012, 20:39
- Contact:
It's still only one color.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.popcan12 wrote:It's called you need to change the spriteset or something of that sort.
Yes, the only way to do this is to mod it. We could pull it off, but we would needpopcan12 wrote:
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...
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.
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.popcan12 wrote:
Well, here's the reason that won't work. You would need to make more of these. This is the block debris.
- Mr.Q.Marx?
- Posts: 849
- Joined: 15 May 2012, 18:35
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.
EDIT: most of the drawing of it seems to be from 366. My mistake.
I think that's the minimap tile colour code.
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.
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
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
and change
to
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.
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
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))
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))
- Mr.Q.Marx?
- Posts: 849
- Joined: 15 May 2012, 18:35
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 wrote:changetoCode: 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))
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))
-
- Posts: 1069
- Joined: 11 May 2012, 18:00
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.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 ,
To further explain: Basically instead of being limited to 2 or 3 breakable brick colours, we're able to use whatever colours we want!pbalazs wrote: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.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 ,
-
- Posts: 1069
- Joined: 11 May 2012, 18:00
Hell yeah . ! good ideaFranpa 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!
edit: yeah sorry for bumping but is Maurice aware of this ? it should be in SE .
- Superjustinbros
- Posts: 2119
- Joined: 29 Mar 2012, 20:39
- Contact:
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?
- BobTheLawyer
- Posts: 2232
- Joined: 01 May 2012, 21:00
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
- Superjustinbros
- Posts: 2119
- Joined: 29 Mar 2012, 20:39
- Contact:
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.
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.