mindfaQ's Forum Posts

  • sprite boolean "moving" is set: set x to sprite.x+dt*instancevarspeed

    or if you don't want to use speed, but time taken to get from 485 to 1700, use

    sprite boolean "moving" is set: set x to sprite.x+dt*(1700-485)/instancevartime

    If you have a bullet behaviour applied and don't want the sprite to move with this, set the bullet speed to 0. Or if you only want the y-portion of the movement, set x to sprite.x-cos(bullet angle of motion)*dt*bullet speed additionally.

    If you want it to stop at 1700, set

    sprite x greater or equal 1700: set moving to false; set x to 1700

  • rock on collison with object - set rock bullet speed to rock.bullet.speed*0,9

    this?

  • set text to right(text.text,len(text.text)-find(text.Text,newline)-1)

  • I don't think Construct can parse pixel content.

  • Because collision is only triggered once (inverting triggers like this (they have a little green arrow on their symbol) doesn't work). You can only check for overlapping.

    So use a varible (global or instance):

    player on collision with block: set globalvariable to 1

    every tick

    global variable not equal 1: actions

    and somewhere after this in the event sheet:

    set globalvariable to 0

  • You probably need an array for that. 1 dimension should be enough.

    When the star progress is saved, instead of saving them to a global variable, save them to the array.

    Set Array at (level-1) = stars (with the condition that stars > array at (level-1))

    This way each level got his "stars obtained"-number saved in the array and it only increases if you obtain more stars in the level than last time. Make sure to set the width of the array to the number of levels you have.

    And to obtain the total stars obtained over all levels:

    -(some event that triggers the total stars counting)

    --subevent: set totalstars(globalvariable) to 0

    --another subevent: array->for each element (X) -> add to totalstars: array.curvalue

  • put player hitting a block into the conditions of the 0.01s-event and invert it (rightclick - invert). This way it only happens when the player is not hitting a block. You could also use an global variable to compare if it is active or not.

  • I still don't fully understand what is happening, sorry.

    Can you explain step by step what is happening? And what should happen instead?

    I see that you destroy the sprites 1-5 that are there. Then it gets blurry, because we don't know how many sprite 6 there are, what the default value of random number is (guess 0), where repeat count is set back to 5, if random number is set back to 0 after a sprite1-5 has been spawned, etc..

    Basically don't know how you handle the variables that seed into the random distribution of your event.

  • let's say end pieces are 30 px wide, mid piece 10px

    Call function with parameters where to start (coordinates, param 0 and 1), how many mid pieces there can be (min: param 2, max: param 3)

    function "createplattform":

    vwidth(localvariable) = 0

    -- : create starttile at (function.param(0),function.param(1))

    add 30 to vwidth

    -- for 1 to floor(random(function.param(2),function.param(3)+1): create midtile at (function.param(0)+vwidth,function.param(1))

    add 10 to vwidth

    -- : create endtile at (function.param(0)+vwidth,function.param(1))

    Just make sure that the origin point of the tile is at 0,0 of the image (not in the middle) or you get overlaps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • add audio to the project, add audio action to play the sound at the appropriate place in the events/actions

  • 1+2 with mirroring the shooting angle as well:

    666kb.com/i/cijnq0pwvv0d2pgfh.gif

    in this example the weapon could only face upwards, but setting up the instance variables can change it to any range (small forward cone etc)

    3: not sure without seeing the capx, workaround could be moving and rotating it with events (e.g. at each tick - set position to player (or a thing attached to him) and set angle to player.fireangle)

  • Select the tiled BG, set the size to what you need. It will only tile for as high as you set it there.

  • Which even sheet gets loaded first depends on the project's properties.

    Also keep in mind that events only run in an active event sheet. So instead of putting the goto in the layout that you want it to go to, put it in the event that is currently running.

    So either make a lobby layout you always load after the level that then decides which layout to load next or put the send portion at the end of your levels.

  • s000.tinyupload.com/index.php

    just setup the height of the array to two and width to number of different animals

    You could take the easy way out and prevent the second dimension by just generating the wav-names out of the animal name. So in the example set next_sound to "sound_"&string&".wav" and next_sound would be sound_cat.wav for example.

    What's bugging me is: cat doesn't work, but dog and bird does. Also adding .wav behind woof would make the dog stop working as well. Really really weird. Maybe I did something wrong, but can't see the problem if there is one. (maybe someone can help)

    If you don't want the comparison to be case sensitive, compare the strings as lowercase (use lowercase(string))

  • What's with it?

    Yes a 3D-game can be rendered in 3D...