AllanR's Forum Posts

  • he had tried that earlier but it wasn't scaling evenly...

    to make it scale evenly without using an instance variable you can do this:

    EDIT: I guess I should have refreshed the screen, but the code above should work fine...

  • Alon

    you have to increase the Size variable. Since it starts at 1, and you don't change the variable, your code will always set the scale to 1.01

    on mouse wheel up, add 0.01 to the Size variable, then set the scale to Size.

  • well, that looked like fun, so I took a crack at it...

    you only add the Touch object to your project once, and that allows for multi-touch. So, you only need one TouchPoint sprite object to track each active touch.

    but you do need a way to tell which side the touch started on, so I also created a PlayArea sprite so that touches would know which player they belong to.

    each touch get assigned to the play area they are initially over, and that is used to select the correct energy bar, score instance, etc...

    the ball speeds up every time a player hits it. there are variable for how long the game goes for (5 right now), how many paddle instances a player gets before their energy runs out (30), how fast the paddles shrink, how much the ball speeds up, etc...

    https://www.rieperts.com/games/forum/touchinput2.capx

  • margins are only used in the C2 editor to show space around the layout so you can place objects off screen.

    setting your layout size to 117,49 means your game screen is 117 pixels wide and 49 pixels high. that is a tiny (on a screen that might be 1920 x 1080) !

    choose a more reasonable layout size... then under project settings you will want to choose letterbox scale, or maybe scale outer. there are tutorials and plenty of examples in the forums on how to set up for different screen types.

  • beta r158 added the ability for the browser object to load a css file. I haven't tried it, but that may allow you to do what you want...

  • I fix a couple minor bugs and added a slider to try different card flip speeds...

    you can re-download it from the link above.

  • do you mean leave a gap between each card?

    to do that you need to divide the width of the card by the total width available, and resize the card to fit the space. Either you have to add in the space you want between the cards, or build the space into the card itself...

    I added the space around the edge of the card to keep the calculation a little easier to follow...

    then added buttons to build different configurations of cards... when you build the deck of cards, you have to make sure there are pairs of cards created, and randomly sort the deck.

    https://www.rieperts.com/games/forum/mem4.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would still do it just like in the example I did above...

    on any touch start, create a touchpoint object to track the touch

    while in touch update each touchpoint object

    on any touch end, destroy the related touchpoint object

    the only extra logic I would add is a lock on the paddles, to lock them to a touchpoint object, so that a player can't try to take over control of the other paddle. (remember to release the lock when the touch is released)

  • could be that the new object is above the mask object. Try sending the new object to the bottom, or move the mask to the top after new objects are created.

  • wow! there is a lot on that road map! sounds exciting... can't wait for the interactive version :)

  • you set the origin (and other image points) in the image editor.

  • probably the origin of the blocks is at the default center, whereas the template might have the origin set to the top left corner...

  • you can give the bullet a gravity value, then it will arch downward.

    if you want it to arch up a little first then start arching down (like shooting an arrow at a target), then tilt the initial angle up a little... then gravity will pull in back down.

  • I think you want to use

    Array - Set value at (Array.curx,7) to Array.at(Array.curx,7) + 12

    array.curvalue is not what you think it is...

  • your loop is running for each X element AND for each Y element. So if your array has 10 rows of data (X), and 16 columns (Y), then the loop will run 160 times.

    you probably only want yo run the loop once for each X element, so you should use:

    "Array - for each X element"