R0J0hound's Forum Posts

  • Those two conditions

    Text->compare variable

    And

    System->pick by comparison

    Should give identical results as you have pictures there. What are the differences you observe?

  • How do you get the screenshot as a gif?

    The simplest way would be to get a snapshot as a png first, then you can run some JavaScript with either the browser object or your own plugin. You would:

    1. Load the base64 into a image. This is done asycronously.

    2. When the image is loaded, draw that image to a canvas of the same size.

    3. Utilize a JavaScript gif library to take the canvas and spit out a base64 gif.

    Skipping to just 3 and using c2's canvas likely won't work when webgl is used. Otherwise notice you cannot get away from base64, so the buggy browsers you allude to will still have an issue. There are probably many gif JavaScript libraries you can find via Google. Any will do, and each is used differently.

    However if after taking the screenshot you just want to load it again then converting it to gif first is a needless step.

  • Here's one idea on how to bend the box around the corners.

    https://dl.dropboxusercontent.com/u/542 ... snake.capx

    There's probably a lot of simplification to be had.

  • Since the system now offers a reasonable z sorter I guess It really doesn't need it in the plug.

    Not really, this can handle sorting situations that the system condition can't handle.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could check if the object's speed is zero. Most behaviors have some way to compare speed, alternatively you could save the object's position to some variables every tick and then right above that event check to see if the current position is different than the current. Probably you'll want small changes to count as not moving. Here's an example permitting anything less than 1 pixel as not moving.

    global number oldx=0

    global number oldy=0

    system compare abs(oldx-sprite.x) < 1

    system compare abs(oldy-sprite.y) < 1

    --- do something since the sprite isn't moving

    every tick

    --- set oldx to sprite.x

    --- set oldy to sprite.y

  • To save as a gif file you'd need to use some js library that can generate a gif because by default only png/jpg is supported. However it will still be a base64 image.

  • No worries, glad you got it working.

  • Hmm... it works with my behavior.

    Try logging the array to the console every step of the way. You can verify this is added to the array by logging it to the array before and after. If it's resetting to empty every time then something is amiss.

    The actual oncreate function in my plugin looks like this:

    behtypeProto.onCreate = function()
    	{
    		if(!this.behavior.state)
    		{
    			this.behavior.state={
    				objList:[],
    				enabled:true,
    				sortOnce:false
    			};
    		}
    		this.state = this.behavior.state;
    		this.isoList = this.state.objList;
    		
    	};[/code:p2uj6fho]
    The only difference is I put the array in an object first, but that shouldn't be necessary.
    Otherwise i'm adding and removing from it in the same way.
  • I looked at what I did and the behavior type is unique per object type you add the behavior too. So I ended up adding it to the behavior itself like so:

    behtypeProto.onCreate = function()
    {
    	if(!this.behavior.mylist)
    	{
    		this.behavior.mylist=[];
    	}
    	this.mylist= this.behavior.mylist; // this is just for convienience
    };[/code:18t9uomz]
  • I handled that in my isometric behavior by managing my own list of instances in the behavior. The list is in the behavior type so any instance with the behavior can access it. Then I add and remove the instances under the create/destroy functions of the behavior.

  • You mean the instance that has the defaults for newly created instances?

    If you save you capx as a project folder and look in the xml files in the layouts folder then look at all the lines with say

    <instance type="TiledBackground" uid="0">

    The one with the lowest uid is the first I think. You probably want to use some searching software like agent ransack to automate the searching.

  • probably the way to do it would be to call a c2 function inside the checkanswer() function and set the global from c2.

  • The beta is as stable as any other release imo. It's labeled beta because that is where new changes are implemented first and sometimes there a glitches related to them. However in the case of the last beta, the fix was in response to facebook changing it's api.

  • int() works for negative numbers.

    int(3.14) = 3

    int(-3.14) = -4

  • It was just fixed in the latest beta, so I assume it works there.