randomly's Forum Posts

  • You could also try the "LocalStorage" object.

    Actually, I'd recommend you use the "LocalStorage" object rather than a whole savegame system since LocalStorage gives you control over what you save, takes up less space and consumes less CPU.

  • Well, I didn't test the Scirra Store yet, but I'd say it's pretty trustable.

    And even if something doesn't work, there's a whole community to ask.

  • I'm afraid, but that's something between you and the store host, we can't sort anything out for you concerning stuff that isn't directly connected to C2, such as third-party stores.

  • (Assuming your points are 1 by 1 pixel)

    You could create an invisible object called "CoorTest" for example.

    You could then create a function with two parameter, x and y and call it "TestCoordinates" for example.

    This function would set the coordinates of "CoorTest" to "FunctionParam(0)" (X) and "FunctionParam(1)" (Y).

    It would then test whether "CoorTest" overlaps with any point, if yes, the fuctions return value gets set to 1, if not, to 0.

    Like that, you could run the function each time you want to check for a coordinate already being occupied and getting the result as a return value.

  • I'd appreciate a capx, yes.

    I don't know how you perform the flipping atm, but I'd just simply lerp (or qerp, whatever you prefer) the width to zero, spawn a new Sprite with the appropriate card face and width 0, destroy the cardback and then lerp back to the initial width.

    You could simply put that card on top of the z-order at any point of the lerps.

  • m302 Could you please re-explain the issue you are having?

    Is it the fact that the ball sometimes doesn't bounce high enough?

  • Yep, just go with the action "Set audio playback rate".

    That's it.

  • Could you please provide the .capx for your project? Thank you.

  • There is those badges containing Upvoting, e.g. "Upvote your first comment".

    Didn't find any button for upvoting comments anywhere though...

    Is the upvoting function disabled or was it removed from the website?

    Or am I just too blind to find it?

    If it is disabled, could you tell me why it was done so? I'd really appreciate that forum function, would improve thread commenting a lot.

  • Your download link has been shortened, make sure to tick "Don't automatically parse URLs" in your post options.

  • If it's sufficient for you to move your character as soon as the swipe ends (the user lifts his finger), you use this solution:

    • add the "Touch" object (obviously)
    • add two global variables "InitialX", "InitialY","CurrentX", "CurrentY" and "TouchAngle", all numbers
    • add an event "On touch start" with the following actions in it:

    --> Set InitialX to Touch.AbsoluteX (or .X, if that suits your project better)

    --> Set InitialY to Touch.AbsoluteY (or .Y)

    • add a condition "Is touching" with the following actions in it:

    --> Set CurrentX to Touch.AbsoluteX (or .X)

    --> Set CurrentY to Touch.AbsoluteY (or .Y)

    • add an event "On touch end" with the following actions in it:

    --> Set TouchAngle to "angle(InitialX,InitialY,CurrentX,CurrentY)"

    Now the swipe direction is stored in the TouchAngle variable.

  • You can also make a condition like this:

    - Every [random(0.5,2)] seconds
    [ul]
    	[li]For each Villain[/li]
    [/ul]          --> Shoot bullet[/code:wbitwzwc]
    
    This will fire each Villain's gun at random times.
    The "for each" causes a random time to be created for every instance of a villain again.
    
    If you want every villain to shoot exactly every 2 second, but at different times,
    choose this:
    [code:wbitwzwc]- Every 2 seconds
    [ul]
    	[li]For each Villain[/li]
    [/ul]        --> Wait [random(0.5,2)] seconds
            --> Shoot bullet[/code:wbitwzwc]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The solution in your last post seems the most effective to me too (and you can modify the affected distance too),

    But I don't see why you would need to set a value?

    Why don't you just putthe collision check as a sub-event of the distance pick?

    This would eradicate the value setting and checking and maybe improving your performance somewhat.

    [EDIT]

    You could also set the distance checked for each TYPE C depending on their width/height.

    This means, you would set the checked distance to

    distance = "TYPEC.width > TYPEC.height ? TYPEC.width : TYPEC.height"[/code:2x64v92q]
    Like that, you would minimize the distance to the smallest value possible and decrease the amount of following overlapping tests too.
  • You probably have set the pathfinding behaviour to go to the point where the touch was, right?

    This only works for non-moving objects.

    To follow a moving object, you need to update the pathfinding every second or so. (depends on your liking how regularly it gets updated. The more often the more ressource intensive the program will be)

    I created a .capx for you, have a look: https://www.dropbox.com/s/xrh10x5z7mmbnwy/FollowBullet.capx?dl=1

  • littleredpanda

    Yeah, that's the basic look I want to achieve.

    Now the thing is, I want to have multiple lights in the foreground and background which have different parallax values.

    To do so, I created foreground and background layers and applied different parallax values to them.

    But I still want those layers to light up the sub.

    Is that possible?

    Here is my current layout: https://www.dropbox.com/s/4basmw18nzmcbb6/SubLight.capx?dl=1

    (Note that the LightCone is lighting up the submarine and the darkness like I want it, but the lights in the back- and foreground don't)

    (Also note that I applied the blending modes and parallax to the layers, not the objects)