randomly's Recent Forum Activity

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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]
  • 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)

  • Well, I don't think your project actually needs 9.405 different Sprites....

    Please tell us what all those tiles are there for, so we can fit the solution to your project.

    Usually, there is no need for that many Sprites.

  • What you could do, is to wrap with NW.js and to insert an action "Run file".

    This file would then be a .bat containing the following actions:

    wmic os get Caption /value > [filedirectory]\filename.txt[/code:392h7voe]
    (Add ",CSDVersion" after Caption to get Servicepack version as well)
    
    The .bat file will save the Windows Version with "Caption=[Windows Version]" to a txt-file in the directory of your choice (make sure to have the rights to write files there).
    
    You would then have to load the txt via the "AJAX" object action (preferrably "request project file") and parse the contents to a variable for example.
    
    Yep, quite complicated.
    But if it's worth it for you... ;)
  • Thanks for the answer.

    So you mean that for the hue I should create a water layer or Sprite which is on top of everything and then just...erase something?

    Should I use a canvas or how am I supposed to achieve that?

  • The problem with your setup is the second pick condition.

    The first pick condition

    Pick Sprite where Sprite.ID = loopindex("a2")[/code:1rx0w2jq] works fine and selects the corresponding Sprite.
    
    The thing is that the second pick condition [code:1rx0w2jq]Pick SpriteFM (family) where SpriteFM.ID = loopindex("a2")+1[/code:1rx0w2jq] from the previously picked objects picks.
    This means that the first pick reduces the picked objects to one Sprite that has the right ID.
    The second pick condition picks the Sprite that has a different ID.
    Since there is no Sprite which has two different IDs at the same time, there isn't any Sprite picked and that's why the text doesn't change.
    
    Now to fix this, you could either just disable the second pick condition
    or
    you could add a second text object, then move the second pick condition to be checked after the first one (as sub-event to the loop) but not as a sub-event of the first pick. You would then change the second text to the second Sprite.ID.
    
    Hope I could help.
  • Whoah man, your post is really hard to understand.

    I don't really seem to understand what you are trying to achieve.

    I guess you want the Space Bar to act as a button for everything? So that it controls every single aspect of menus?

    If that is the case, I don't see how that would be possible...if there are multiple possibilities for the user to choose from, how is the program supposed to know which one of those the user wants to pick when pressing the Space Bar?

    Could you please clarify your intentions?

  • I'd be happy to help you, but you need to provide us with a .capx not a .caproj

    You can do so by going to "file" -> "Save as" -> Select .capx as filetype -> save -> upload -> share link

randomly's avatar

randomly

Member since 26 Sep, 2016

Twitter
randomly has 1 followers

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies