Sprite placement tweak
Thu, 2015-04-09 13:43
This is kinda for mikade, since I so rarely see him these days...
-- test of modification of PlaceSprite. 0.9.22-dev function onGameTick20() if GameTime%1000 == 0 then PlaceSprite(GetRandom(LAND_WIDTH),GetRandom(LAND_HEIGHT), sprThoughtCorner, 0, (math.random(30,250)) -- A + (math.random(30,250)*0x100) -- B + (math.random(30,250)*0x10000) -- G + (math.random(30,250)*0x1000000), -- RGBA R GetRandom(2)==1, -- don't overwrite existing land. GetRandom(2)==1, -- flip sprite horizontally GetRandom(2)==1, -- flip sprite vertically lfBouncy) EraseSprite(GetRandom(LAND_WIDTH),GetRandom(LAND_HEIGHT), sprThoughtCorner, 0, GetRandom(2)==1, -- erase land only where the pixels match the land flag provided GetRandom(2)==1, -- only erase the provided land flags. don't touch other land flags or LandPixels GetRandom(2)==1, -- flip sprite horizontally GetRandom(2)==1, -- flip sprite vertically lfBouncy) end end
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
Vaguely related, although I'd mentioned it to him before.
http://m8y.org/hw/NeonRope.lua
http://m8y.org/hw/neonrope1.png
http://m8y.org/hw/neonrope2.png
Racer now has:
elseif GetGearType(gear) == gtRope and TeamRope then
SetTag(gear,1)
SetGearValues(gear,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,GetClanColor(GetHogClan(CurrentHedgehog)))
in onGearAdd
teamrope=1 in scheme
(vaguely related in that it is lua and the random colour set is the same ☺ )
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
This looks interesting...
oh hi
Thinking I'll tweak erase to add as an option only removing land flags passed in, not all Land/LandPixels.
Could use that to toggle bounciness or indestructibleness of something more easily, or placing a sprite, then removing all collision from it, for graphical purposes only.
*done*
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
Looks good. Now what we need next is option to show custom/variable sprite at cursor. That way we can finally have a more accurate editor and Construction Mode can look less hack-y, too.
mikade
Hedgewars Developer
AND "Level Editor" mission.
oh hi
Well, yeah. I imagine it could be used in the level editor script I linked to -> http://hedgewars.org/node/6162. If I could get custom sprites at cursor (I think sheepluva was working on this) I'd be happy to do some updates.
mikade
Hedgewars Developer