razorMonkey's Forum Posts

  • Hm, is it possible that DEMO construct prevents this? You should select car and then "Pick by unique ID"

    Maybe you searched UID?

    BTW does it work now?

  • Maybe something else is the problem. Can you give me capx?

  • and is ther a way to shuffle on event ... like shake

    Wait, do you need to spawn each of them only one time, just in random order?

    Because with my example it can give same slice twice or even more times.

    And what do you mean by shuffle? Do you have capx of that project?

  • From this pic I can see only one possible problem.

    In this picture your eye will only shoot if wizard is visible exactly at the end of every second second. (no pun intended)

    If you want to shoot at the player moment it sees him/her you should, instead of "Every 2.0 seconds" put variable inside eye that will act as a timer from which you will subtract dt, and then condition will be "if Enemy_Eye.variableName < 0", and you will need action "set Enemy_Eye.variableName to 2" (put together with spawn action)

    EDIT:

    also check "range" and "cone of view" of Line of sight behavior.

  • Other way would be with compare values, for example:

    if rand(100) > 50 = spawn object1

    else = spawn object2

    means you have 50% chance for object1 and if it fails 100% chance for object 2

    EDIT

    This is all pretty basic and crude but it works with basic functions, maybe there is some more elegant way.

    Other way, if you want all objects to have same spawning chance, is to create variable and then put random number into it: vrandomVariable = random(number of objects)"

    And then for every object put one condition like

    if randomVariable = 1 - spawn object1

    else

    if randomVariable = 2 - spawn object2

    else

    if randomVariable = 3 - spawn object3

    and so on

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Simple way would be to put all objects into one family and then spawn family.

  • Do you have some capx where you would like me to add that? I believe it would be pointless here to create that from scratch.

  • One way would be by comparing touch x and y position.

    When touch begins store touch x and y in variables. Then if touch x > stored x + desired distance that means player swiped his finger to the right by that distance.

    Touch x < stored x - desired distance = right.

    Touch y < stored y - desired distance = up.

    Of course, that could mean player could swipe on whole screen for such effect, if you want him to swipe only on designated joystick object you should add event above "is touching object"

  • One option would be to give it a bullet behavior and then change angle of motion by 180 when it collides with an obstacle.

    Of course, it is just a start. Jumping and falling will need additional actions.

  • For some reason your game does not work on my crappy PC I have here, so I cannot test it but hope this will work. Also your game is HUGE, 22mb, I would recommend compressing some of the music.

    Problem is that you have not designated your car so game is using all cars available.

    One solution would be to create global variable which will store "license plate" or "UID" of a driven car. (as I did between line 43 and 44 on this picture and called it carUID)

    Then when you enter the car you will have to put its UID into that variable (last action on line 44)

    Then you will have to pick said car by that variable before you do anything with it. (line 38 and line 46).

    Also in every other action where your driven car is doing anything, it will have to be picked same way.

    Hope it works now.

  • Do you use physics engine by any chance? It should not be combined with another behaviors.

    Also can you post a picture of your event sheets?

  • Are you sure your player is not on the layer below background, so it is maybe hidden by background?

    Try to create new layer on top of every layout (sall it "player") and then when you create player put it on that layer? (you can refer it by name with quotation marks, like "player", not just by number)

  • You can select object behind other object by holding TAB and clicking. Hope that it helps.

  • You could use condition "System-Compare two values" and the type in "sprite.Pathfinding.MovingAngle".

    You will need 8 double conditions for every combination:

    One which includes 0 angle will have to look like this:

    If sprite.Pathfinding.MovingAngle > 337 or sprite.Pathfinding.MovingAngle < 23 then "look east"

    Others will have to look like this:

    If sprite.Pathfinding.MovingAngle > 157 and sprite.Pathfinding.MovingAngle < 203 then "look west"

    If sprite.Pathfinding.MovingAngle > 203 and sprite.Pathfinding.MovingAngle < 247 then "look north/west"

    and so on..

    EDIT

    also use else between them for better performance

  • You have to pick the right car with condition beforehand. Can you post capx or picture with code where car entering is managed?