R0J0hound's Forum Posts

  • 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.

  • 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.

  • You need a seperate frame per image.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Function.param(v) isn't right. To access the first parameter use function.param(0). So maybe set v to that first.