AllanR's Forum Posts

  • fldr

    I haven't tried what you are doing, but I know you can get around confusion (ambiguous calls) between objects of the same type by using a family. Create a ShipFamily and put your Ship object in it. then:

    "if Ship has los to ShipFamily"->"shoot at ShipFamily" will help distinguish between who is shooting and who is the target.

  • goodeddie

    I tried Lordshiva's boomerang capx, and it launches when you click the mouse button, but it doesn't adjust the angle or velocity in relation to the mouse motion the way you wanted...

    Here is a sample I made for someone a couple weeks ago (it started as a project to show the dots for a trajectory, and ended up being an angry birds clone). You can launch red birds with the slingshot - it sets the angle and velocity based on how you pull it. You can also pick up a white bird and just toss it. It works with both mouse and touch (and works well on my iPhone). Obviously, you have to calibrate the velocity when you throw things to match how you want the gameplay to work...

    http://www.rieperts.com/games/forum/angry_birds.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • matriax

    You could use functions. Create a function for each sound you want to play. Put all the sound functions in a Group.

    Then, where ever you want to play a sound in your code, just call the appropriate function.

  • Solomon

    Blackhornet is right - Pick Top/Bottom instance is the easiest way to get only one.

    you can find it way down at the bottom of the object add event screen - under Z-order.

    You can also use object.PickCount to see if you clicked on more than one. And you can do a For Each object to loop through all the instances clicked on and manually choose some other way which one (or more) to delete.

  • R0J0hound Thanks! that is good to know.

  • Ethan

    the problem is that the System > Create Object takes some time to actually create the object (or at least add the new instance to the list for that object - that seems to happen on the next tick).

    So, when the function is trying to Pick the Sprite2 nearest to Sprite, it doesn't know the one you just created exists yet. Therefore, it doesn't pick it, and then the Sprite.isChanged variable is not getting set to true, so the next time through the Repeat loop that Sprite is still available to have a Sprite2 created on it.

    Having a function re-loop through every Sprite while in a Repeat loop isn't an ideal way to do things. It would be better to pass the Sprite.UID into the function as a parameter, then in the fuction Pick Sprite by UID. Then you can do what ever you want to it - without having to loop through other instances. You can also pass the Sprite2 UID into a function and pick it as well. (trying to pick it using Pick Nearest doesn't work, but picking it directly by its UID does work).

  • tekkendp

    the image points do move as you change the size of the blue sprite. But the green sprites just stick to the original position where they were pinned - so you need to unpin them, move them to the new image point locations, and re-pin them when you change the size of the blue sprite.

    and since the green sprites are the same object, you will have to pick the first instance, move it to imagepoint 1, then pick the second instance, move it to imagepoint 2.

  • SowSow

    your ajax request is calling http://thefunkkystreet.livehost.fr/stars/login.php

    but I get a 404 page not found at that address, so it looks like you are calling the wrong page address...

  • justintime0185 Capx is just a Construct2 project saved as a single file.

    you say you are already moving the player to a new layer... if you are sure he is on the correct layer, then try setting him to the top of the z-order as well... if he is still behind something, then those objects are not on the layer you think they are (or the player isn't).

  • therock24 see this thread from yesterday... (it works for both mouse and touch)

    https://www.scirra.com/forum/how-do-i-use-swipes-to-move-an-object_t152773

  • artbava no, you should remove the custom movement (I forgot to). The second version uses Physics to move the ball, and physics slows down the ball using friction and linear damping, so there is no need to manually decelerate the ball.

    the elasticity sets how bouncy the ball is. Linear Damping should be the main way to slow the ball down - I had it at 0.2 to keep it moving a long time. Try something like 0.9 to slow it down at a faster rate (and/or apply less acceleration to the ball).

  • I see mindfaQ beat me to it... but maybe you missed the manual entry for Arrays

    https://www.scirra.com/manual/108/array

    You can use POP, and Push to shift values left or right, Insert or Delete, Reverse, Sort, lots of good things to do just what you want.

  • TMAJA using Left would require knowing how many characters to the left of the decimal you have (which may work fine if you are just working with the alphabet or know you will only have one digit names). If your string objects potentially have names longer than one digit, then you could use TokenAt

    eg: global variable = TokenAt(string,0,".")

  • fundation2000

    Like C-7 said, you should separate the showing of pages from the waiting for input...

    I made a quick test: http://www.rieperts.com/games/forum/ChangePage.capx

    But, I would seriously think about creating your pages as you need them, rather than pre-building them in the editor. 50+ pages is a lot of layers to manage, and if you want to change the general look, you will have a big job on your hands!

  • vijayrajesh that example does not use Touch, mouse only. Touch gets a little tricky because there is no Left and Right button or middle Scroll Wheel. I was working on a multi touch interface last month, and would want to track each touch point to make a proper touch paint program...

    but for now I quickly adapted the capx above for touch. You can't change the size of the brush. The second touch point becomes an eraser... It wouldn't be hard to make a proper tool palette to change brush size, color, etc.

    http://www.rieperts.com/games/forum/CanvasPainterTouch.capx

    The Canvas plugin does have various ways to draw curves - so getting smoother lines would be possible.