matriax's Forum Posts

  • dop2000 Oh, thats why i was afraid.

    But, 256 colors and what resolution?

    My idea is a PixelArt game, up to 320x180 resolution and 16 colors max without antialising (Sampling=Point instead linear).

    Mainly keep the specs low to allow do more crazy/cool stuff with this pixel destruction thing, lots of ideas but still working in a simple design with families and all well organized before start the fun thing, hope have some .capx version tonight.

  • dop2000 Yes is what i'm saying, but instead of destroy canvas just save to .json the tilemap creation and for gameplay just create only the tilemap and load the tiles by .json without even create the canvas object.

    Love the color palette idea using the tilemaps and deleting sprites, so get RGB values from canvas and create X conditions to asociate each RGB color picked with a tile in the tile map to be added.

    The unique thing is that i'm afraid that due is pass from using a single tile to lots of different ones for each color maybe the perfomance can slowdown but well, is another thing to test, thanks!

  • Trying to save objects for perfomance. I mean, for moving objects each one will have their own tilemap and using canvas also they will need to have one but thinking better as you said in the comments i guess will be run one time with canvas on to get the transparency for the tilemap and then save the tilemap family as json and run the gameplay version without the canvas, just loading the tilemaps generated. I don't know if i'm missing something.

    Hope get some time to put all the ideas and organize to make a test to see if all this can be done with a good perfomance. Also adding physics and other stuff like control the pixels in a way to do some Sine movements, maybe there is a way to do a realistic water, sand or similar. Just pushing C2 to the limits to see until what point can be achieved with enough perfomance to build an interesting gameplay.

  • dop2000 Oh yes! i don't see that, instance removed!. I guess this means is possible do various tilemaps without problems so to do the objecs movable with their tilemap should be ok with perfomance.

    ---

    R0J0hound Wow! what a workaround, i don't know that can be done in C2 :O

    Well, does the job i want, but uses an image from the project file, is there any way to set to a Family? So, i can add any sprites there to be "rendered" in the tilemap automatically.

  • I see, at the moment i will continue without canvas plugin wonder the limit i can go .

    Also was thinking on destructible moving objects and if i'm right to do that will be something like:

    On start layout + for each SpriteMovable(Family) create a tilemap with Sprite width/height, set tiles for the sprite form and pin pos+angle. I don't know if i'm missing something.

    If all this is possible(And perfomance is still good) i can see a good destruction game here, i'm gonna do some tests

  • dop2000

    "With complex shape buildings you might need to check overlapping for every pixel."

    Are you saying is possible do complex buildings or recreate sprites with alpha in tileson tilemap without use the canvas plugin or i misunderstood you? :O if true, how? In your examples i tried to modify the sprite but not just fill the rectangular.

    Love what you did with the complex windows, maybe i can use that for explosion to make complex holes instead the round one.

    EDIT: Oh! :O just realized that changin the erase tile by set tile in your last example you can recreate that sprite based on their collision that is great. Wonder if there is a way to make them pixel precise using the sprite transparency instead the collision, but here maybe the canvas plugin is required

  • Here is an idea - set "Blend mode=source atop" for buildings and use tilemap as a mask. (and also as a solid surface for tanks)

    https://www.dropbox.com/s/bpy9vgw7df50z ... .capx?dl=0

    Oh! The source Atop do the job well, thanks <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    But i not understand why you dfill the objects in that way, is more faster/optimized after in runtime than this?:

    https://cdn.pbrd.co/images/GXI2AX5.png

    Ok, so now only the sprites with alpha left, so i guess in this case is use the canvas plugin to detect the alpha and erase the tiles with them or rework the tiles addition to run all coordinates in the canvas an set 1 tile in the tilemap for the ones that not have alpha, i don't know wich one will be better. BTW, i guess if after run i can save it as .json as described and load fast i think no matter.

    PD: dop2000 i bought you a coffe, i think, i don't know how much cost in australia XD

  • Well just get it for Rectangular objects

    Wonder how get for the ones with alpha mmm...

    EDIT: One idea is paste that layer object into your canvas plugin and get the RGBA and detect if have alpha > remove tile. But i guess this means do an arrays that test all the pixels in the canvas looking for the alpha ones. Mmm, i will try later.

  • I'm doing a prototype trying pixel destruction and this is just what i need.

    R0J0hound Is there any way to add an sprite in the layout and when the layout starts make the tilemap adds tiles there?

    Or maybe other way to build a terrain using just sprites and on runtime add tiles in the tilemap so you can make any kind of terrain easily.

    I made a fake destruction pixel using the DestinationOUT blend

    The idea was then make if collides with building and is not overlaping one of the bullets with destinationOUT explode so you can make holes , but is not pixel precise and perfomance drops when losts of bullets blends , but well as first aproach was interesting .

    So, my idea is add a sprite, on runtime set tiles from tilemap there and use the destinationOUT to make the sprite looks destroyed equal i did for the blue buildings in the gif. But can't find a way to achieve the first step :S

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This code edit the RGB values of the overall image

    varying mediump vec2 vTex;
    uniform lowp sampler2D samplerFront;
    uniform lowp float red;
    uniform lowp float green;
    uniform lowp float blue;
    
    void main(void)
    {
    	lowp vec4 front = texture2D(samplerFront, vTex);
    	
    	gl_FragColor = front * vec4(red, green, blue, 1.0);
    }[/code:1q7tkhkd]
    
    To work as Highlights/Midtones/Shadows RGB correction needs 9 properties, 3 RGB for each one:
    
    [Highlights] Modify the RGB values with 255-170 of light
    Highlights RED
    Highlights GREEN
    Highlights BLUE
    
    [Midtones] Modify the RGB values with 170-85 of light
    Midtones RED
    Midtones GREEN
    Midtones BLUE
    
    [Shadows] Modify the RGB values with 85-0 of light
    Shadows RED
    Shadows GREEN
    Shadows BLUE
    
    I don't know how explain, trying to find some page that explain how exactly works, but the idea is the same as the code posted but to works separated on the highlit, midtones and shadow zones of the image. So, i guess does something like that.
    
    Any idea?
  • MadSpy Thanks! worked!

  • I can take a snapshot and then use the "invoke download" action and give the "CanvasSnapshot" on url and the filename.

    But the "invoke download" shows a dialog to save the file.

    The idea is simpy press "S" for example and take a snapshot and save automatically as Snapshot001.png in a folder. I'm trying to do a Batch processing so giving 10 image files(Using file chooser) and apply X effects and then save as image01.png, image02.png ,etc...

    So i tried this:

    On press the key, the file test.png is automatically created with 240kb, i try to open but says is not a .PNG file. I opened in a text editor and compare with an other .PNG file and looks very similar, so i guess there is something i'm missing.

    How to fix it?

  • I saw there is a "ID (Optional)" property in the left pad of the plugin for CSS style but i can figure how call from CSS style and change the text in the button or whatever.

  • With the plugin button you can configure the text but with the file chooser not, so appears this:

    I guess to change that have to be using the CSS style action but how to know which atributes are or how? Any doc? I read the Button/Text manual and appears this:

    [quote:34shgf6a]Make the text red: Set "color" to "red"

    Make the background yellow: Set "background-color" to "yellow"

    Make the border a thick light grey: Set "border" to "3px solid #AAAAAA"

    Make the font bigger: Set "font-size" to "2em"

    Make a dashed red border: Set "border" to "2px dashed red"

    But that plugins have the change text on their properties but no file chooser. So how i do that?

  • I'm using the User media plugin that explains here:

    https://www.scirra.com/manual/144/user-media

    I achieved to record the video but without audio. C2 supports audio record from canvas ?

    Or there is any other plugin that can record video+audio from canvas?