Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Need help to make a 2d pixel sandbox style game — Gideros Forum

Need help to make a 2d pixel sandbox style game

edited March 2023 in General questions
I am making a game like this: (Focus on android and iOS platforms)

https://github.com/angeluriot/Sandbox
https://play.google.com/store/apps/details?id=com.wonder.psychicdust.an&gl=us
https://github.com/The-Powder-Toy/The-Powder-Toy

What is the best way to make the elements (materials)?

1. Pixel class in Gideros
2. Particle system (Like the demo from Gideros)
3. Or find some C++ engine and make the Gideros plugin

Thank you so much!
Coming soon

Comments

  • MoKaLuxMoKaLux Member
    edited March 2023
    LiquidFun particles? https://wiki.gideros.rocks/index.php/B2.ParticleSystem

    With its flags system you can have interesting behavior:
    flags=b2.ParticleSystem.FLAG_COLOR_MIXING | b2.ParticleSystem.FLAG_POWDER,

    I used it a long time ago and was really fun but I didn't push it very far.
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
    +1 -1 (+2 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Member
    edited March 2023
    there is also a GH demo of it: https://github.com/HubertRonald/FoulJob
    Don't be fooled by the YT video (this is not the GH game), he uses LiquidFun particles but you will have to replace bit.band and bit.bor because bit got deprecated in Gideros 2022.1 (you can just comment the faulty lines but you won't see the tiles!)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • piepie Member
    @MoKaLux Cool, I didn't know I was featured there! :smiley:
    What do you mean with replace "bit.band and bit.bor"? Is there an alternative?
    If we can no longer use the bit library we've lost the ability to flip tiles on Tiled maps :disappointed:

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Member
    edited March 2023
    pie said:

    @MoKaLux Cool, I didn't know I was featured there! :smiley:
    What do you mean with replace "bit.band and bit.bor"? Is there an alternative?
    If we can no longer use the bit library we've lost the ability to flip tiles on Tiled maps :disappointed:

    So you are Hubert Ronald? You are a Gideros Legend pie o:)

    For the bit thing, to flip tiles in Tiled I think there is another solution (tested with images not sure for tiles):
    	-- Bits on the far end of the 32-bit global tile ID are used for tile flags (flip, rotate)
    	local FLIPPED_HORIZONTALLY_FLAG = 0x80000000;
    	local FLIPPED_VERTICALLY_FLAG   = 0x40000000;
    	local FLIPPED_DIAGONALLY_FLAG   = 0x20000000;
    ...
    	-- read flipping flags
    	local flipHor = xobject.gid & FLIPPED_HORIZONTALLY_FLAG
    	local flipVer = xobject.gid & FLIPPED_VERTICALLY_FLAG
    	local flipDia = xobject.gid & FLIPPED_DIAGONALLY_FLAG
    	-- clear the flags from gid so other information is healthy
    	xobject.gid = xobject.gid & ~ (
    		FLIPPED_HORIZONTALLY_FLAG | FLIPPED_VERTICALLY_FLAG | FLIPPED_DIAGONALLY_FLAG
    	)
    	local tex = Texture.new(path..tilesetimages[xobject.gid].path, false)
    	local bitmap = Bitmap.new(tex)
    	bitmap:setAnchorPoint(0, 1) -- because I always forget to modify Tiled objects alignment
    	local scalex, scaley = xobject.width / tex:getWidth(), xobject.height / tex:getHeight() -- supports Tiled image scaling
    	-- convert flags to gideros style
    	if(flipHor ~= 0) then scalex = -scalex xobject.x -= tex:getWidth() * scalex end
    	if(flipVer ~= 0) then scaley = -scaley xobject.y += tex:getHeight() * scaley end
    	if(flipDia ~= 0) then -- not tested!
    		scalex, scaley = -scalex, -scaley
    		xobject.x -= tex:getWidth() * scalex
    		xobject.y += tex:getHeight() * scaley
    	end
    	bitmap:setScale(scalex, scaley)
    	bitmap:setPosition(xobject.x, xobject.y)
    	bitmap:setRotation(xobject.rotation) -- image rotated in Tiled?
    ...
    Hope this helps ;)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • piepie Member
    edited March 2023
    @MoKaLux no, no I am just a normal pie, @HubertRonald the legend is himself. I somehow managed only to put together the support for tiled flipped tiles in gideros tilemap class (adapting someone else code) and I am just credited on the page for that reason :)

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • Ah I see :o yes indeed you got featured, that still makes you a Gideros Legend o:)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • piepie Member
    MoKaLux said:


    Hope this helps ;)

    Thank you it helped a lot: the bit library was deprecated because bitwise operators were embedded, therefore THERE IS an alternative.
    Updated tilemap with tileflip support https://github.com/piretro/Gideros-Tiled-Tilemap-Flip-Support and wiki bit lib page with relevant information :smile:

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • I found this link is a very fun and cool way to create a sandbox game. Hope you enjoy it
    https://sandpond.cool/

    (Do not mean it can be done in Gideros)

    Likes: MoKaLux

    Coming soon
    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.