R0J0hound's Forum Posts

  • Extracting the runtime portion from a minified export is not really doable. I mean at most you could possibly get the minified version of the runtime with a lot of trial and error. Unfortunately all the names would be mangled so it would be a real chore to fix that into a usable form.

    To be able to open a capx that uses one of those plugins you'll either have to remove all references like newt says, or you can recreate the edittime portion from the capx. After you unzip the capx you can get all you need to recreate it.

    The plugin's id can be retrieved from the .caproj file under used plugins or behaviors.

    Next you need to add all ACEs. The event sheet xml stores the id of the action/condition and all you need to recreate it in the edittime is the id and parameters need to be the same. Properties can be done similarly by looking at an instance in a layout xml. just keep the same order and type and you should be ok.

    That at least can let you open it. Hopefully your plugins are in an old c2 install somewhere though.

  • The Sprite.pickedCount expression gives that info.

  • Look here for everything about hexagon grids (all kinds). You should be able to do what you want refering to that.

    http://www.redblobgames.com/grids/hexagons/

  • This is a situation where joints wouldn't really cut it. The box2d and chipmunk libraries let you attach multiple shapes onto the same physics object, which is like a perfectly rigid joint. The only work needed is calculating the center of mass and inertia of the object as shapes are added/removed.

    It's probably easier to to do by accessing the js libraries themselves to do it rather than using the behaviors. Not to mention it would give more control.

  • Ideally you'd use the plugin sdk to access javascript.

    But you can use the Browser object with it's exec js action to run some javascript.

    You can load a js file in your project folder as if it was included in your html file by executing this:

    "var js = document.createElement('script');
    js.type = 'text/javascript'; 
    js.src = 'chipmunk.js';
    document.body.appendChild(js);"[/code:300sntdv]
    The library takes time to load though, so you can't use it immediately.
    
    Another option is to load the the file into a variable with the ajax plugin.  Then you can use exec js with that.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Couldn't you just flip everything?

    switch width and height in the equations. As well as the x and y's?

    So maybe this?

    On drag drop

    • set x to round((Touch.x - 280) / self.width- self.y / 2))
    • set y to round(4*(Touch.x - 320)/(3*self.height))
    • set position to (self.width*(self.x+self.y/2) + 280, self.height*self.y *3/4 +320)
  • I'd recommend looking at Ashley's blog for lots of info about C2's performance and what affects it.

    https://www.scirra.com/blog/ashley/21/u ... asurements

    I can't run your projects right now, however...

    Behaviors do use performance but it varies per behavior. Also to have a fair comparison between events and a behavior they should give you the same results. But yeah, if you're doing something simpler than the behavior you can do it with events and be faster in cases. The reverse can be true as well. I did some complex isometric sorting with events, then made a behavior to do the same thing and got a performance increase.

  • It's an interesting problem. You'll have to use a force for the air friction. The basic formula for that is:

    Friction force=-velocty*b

    Where b is the strength of the friction.

    The amount of air friction (or drag) would vary according to the angle of the frisbe relative to it's direction of motion. The force would be greater when the frisbe is perpendicular than when it's parallel to the motion.

    So we could write it like this:

    Drag=-velocty*b*sin(anglediff(frisbe.angle, frisbe.angleOfMotion))

    Well, actually if we want to use the apply force at angle action we can do this:

    Angle: 180+angle(0,0,frisbe.physics.veloctyx,frisbe.physics.velocityy)

    Force: b*sin(anglediff(frisbe.angle, angle(0,0,frisbe.physics.veloctyx,frisbe.physics.velocityy)))*distance(0,0,frisbe.physics.veloctyx,frisbe.physics.velocityy)

    Also I did something similar before with falling leaves which you can find with a forum search. It could be useful.

    That still probably won't like a frisbe would move so maybe you could simulate the gyro effect of spinning objects be using a variable to specify the spinning speed of the frisbe and make it harder to tumble when it's spinning. Another is modeling a better physical shape for the drag, since with the above it would be treated as a flat disc.

    Anyways that's just some ideas of the stuff you could do. You maybe could even do something simpilar that looks better.

  • You can't do that in construct, since it runs with html5/javascript and it would be a security violation to let stuff that runs on a webpage simulate keystrokes as if the user pressed it.

    To do it you'd have to use something much lower level that has access to the winapi, and even then simulating a keystroke in another program is kind of hacky.

  • [quote:2sz57ylx]So how do you do it then?

    You could add 1 to Play_time instead of 0.1 and whenever you want to look at the value divide by 10.

  • tulamide

    Someone made a plugin here:

    But I don't know if it has the level of features you're looking for.

  • I was referencing event numbers in the last capx you posted. To fix it, add a "pick all spite" condition above the "for destroy" loop in the same block.

    Before that fix or even phimaka's function solution, the loop did run, only it wouldn't destroy any other sprites other than the rightmost one because it was the only one that was picked before the "destroy" loop.

  • Does the microsoft browser work?

    Besides addons you'll have to look in your browser's settings to see if javascript is disabled. By default it wouldn't be disabled, so presumably your friend disabled it, or some antivirus/security software he uses disabled it.

    As an example for chrome I found it under settings->advanced settings->context settings...

    In the javascript section there are settings to disable it completely or block or allow certain sites.

  • It's not a bug it's the way picking works.

    Event 4 picks only the sprite overlapping the Scan object, so in the sub event 7 you'll only be checking for an overlap with that sprite. If you want to check for overlaps with all the sprites then functions work since what's picked isn't passed to the function. Another idea would be to use the "pick all" condition.

  • You could use a regex search i suppose. Find in C2 uses a regex.

    You could also use the javascript "indexOf" to do it. It's case sensitive.

    global text variable="Aa"

    start of layout

    Text: set text to Browser.execJS("'"&variable&"'.indexOf('a')")