R0J0hound's Recent Forum Activity

  • Instead of finding that example you speak of I tried my hand at making it again. It seems finicky to set up the joints correctly.

    https://www.dropbox.com/s/9q8a0b2kpbzesv6/ropePhysics.capx?dl=0

  • skymen

    Fixed link

  • Added two more examples/experiments.

    Also as a "mini tutorial", this is all you need to do to draw something:

    1. Load a texture from a sprite. This can be done as often as you'd like. Despite saying "load" this is instant.

    2. Add four vertexes or use the "add rectangle" action. The "add rectangle" and "add vertex XY" actions will set the UV coordinates of the vertexes automatically. Use the "add vertex XYUV" action to manually set the UVs.

    3. Use draw action to draw quads. It will draw a quad for every four vertices.

  • number%10 will get the last digit.

  • From the sdk manual you can get the SOL:

    https://www.scirra.com/manual/29/object-type

    so you can get the current SOL with:

    var sol = obj_.getCurrentSol();

    The docs say to not modify other object's sol but I guess you could modify it, call that action, and then change the sol back to what it was.

    //save current
    var old_instances = sol.instances;
    var old_select_all = sol.select_all;
    
    // set new
    sol.instances = [this.pinObject];
    sol.select_all = false;
    
    // call action here
    
    //restore old
    sol.instances = old_instances;
    sol.select_all = old_select_all;[/code:3vdezqca]
  • I guess it's possible to put the html/css inside an svg file and draw that to the canvas. I found a library that does it but I was only able to use it in Chrome. Didn't test Firefox. Edge and Internet explorer can't do it.

    https://developer.mozilla.org/en-US/doc ... o_a_canvas

    http://cburgmer.github.io/rasterizeHTML.js/

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Odd. I'd recommend trying the browser's debugger. Open it and select the sources tab. Clicking on a line number will add a breakpoint. That will cause execution to stop so you can inspect the values of everything, and advance it a line at a time. It might help you see some logic errors?

  • Mubot

    I put an updated link in my post

  • You need to use the "call" method to set what "this" is.

    So change this line:

    this.inst.type.plugin.__proto__.acts.ZMoveToObject(1,this.pinObject.type);

    to:

    this.inst.type.plugin.__proto__.acts.ZMoveToObject.call(this.inst, 1,this.pinObject.type);

  • Fun list. I haven't spent a whole lot of time with C3 yet, but I like your ideas to push the limits. I especially like the conditionals idea, it makes me wonder how deluxe a game could be made with one event. Anyways in the spirit of the topic here are a few more ideas:

    8. Utilize behavior's as much as possible instead of events. A behavior won't always fit with what you want to do but it sure is nice when it does or even is just close enough.

    9. Make a simple scripting language to control your game. Admittedly it may be pretty tricky to cram that in 25 or 40 events but if successful you'd be able to have a lot more logic. Being able to type multi line text for text properties in c3 is useful for this.

    I'm drawing a blank for any other general ideas, no doubt there others.

  • One way to find it is to was console.log(this); somewhere in your plugin. Then you can open up the developer console and you should be able to click the arrow by "this" and browse the object tree.

    But off the top of my head since I was messing with this recently:

    this.inst.type.plugin.prototype.acts.zmovetoobject.call(this.inst, ...)

    Sorry I neglected the capitalzation, I'm on my phone.

  • You can have the javascript code call a C2 function.

    See javascript intergration section.

    https://www.scirra.com/manual/149/function