R0J0hound's Forum Posts

  • It continues by having each tile play it's own note and since they move down the song is played as you click on them.

    Example:

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

    It also includes a trick to use one sound and changes it to play other notes.

  • Everade

    That old sat example treats the player as a circle and collides with the bounding box of a wall not the collision polygon.

    Here's a newer example that would be more useful.

    It still can't access an object's collision polygon since there is no way to access it with vanilla C2. Instead you just use imagepoints to define the polygon of the walls. The player is still defined as a circle.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't understand.

  • They likely just use their own engine but it can be made in pretty much anything, even Construct. It's not terribly useful to give a pre-made example. Instead if I can show you how to take any game, and break down what it does in detail you'll be able to make that game.

    For example you want to make a game like piano tiles. Well, what does that game do?

    One possible description would be: Black squares move down the screen, and when you tap those tiles a note is played. We can do that. With one event we can have a sound play when you tap a tile. One way to make them move down in to to use a movement behavior like "bullet". You just need to set the sprite's angle to 90 so it goes down instead of right (0).

    That's simple, but to make it more like piano tiles you need to describe the game better:

    A grid of black and white tiles move down the screen. If you tap a black tile a sound is played. You lose if you tap a white tile or if a black tile moves off the bottom of the screen without being tapped.

    So we need to figure out how to keep track if a black tile has been tapped, and we need to find out when the tile goes off the bottom of the screen. A variable can be used to keep track if a tile has been tapped.

    on sprite touched:

    ---> play sound

    ---> sprite: set beenTapped to True

    You can compare the y position of the tile to see if it has moved off the bottom of the screen.

    sprite y > 480

    [inverted] sprite: is beenTapped

    ---> game over

    Anyways you can continue in that manner and make the game more and more complete.

  • Correct me if I'm wrong but don't you have to tap other tiles for the music to continue in that game?

  • Probably the simplest way is to add these three objects to your project:

    Touch, Audio and a Sprite for a tile.

    Then add a note sound effect to your project and add this event to the event sheet:

    Touch: on sprite touched

    ----------> Audio play note sound

    Preview that and you have a square that plays a sound when you touch it. More notes can be as easy as adding another sound, another sprite and another event.

  • 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

  • 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);