LittleStain's Forum Posts

  • So using the above you could add actions to either one of the enemies in the collision, preventing the overlap.

    sending one of them temporarily in a different direction would do the trick, or increasing/decreasing the speed of one.

    It depends on what you would like to happen.

  • Using a family would be the best option, but for that you need the paid version of construct2.

    Without families, putting the animations together in the same object would be the best option to reduce the amount of events.

    That they are all different in size and shape shouldn't matter much.

    While writing specific actions for a specific type of enemy you would only have to check which animation is playing or have an instance variable telling you which enemy it is..

  • So here's how I would do it:

    capx

    (Not completely true, because I would try to prevent the text-update being performed every tick, but for now it will do)

  • Ok..

    What I said wouldn't take a week.

    You don't need global variables, because like I tried to explain using instance variables would work.

    I don't now what total.points is, I was talking about green.points and green.totalpoints.

    If you set green.totalpoints to 2*green.points there will be a difference, because 2*something is different from 1*something, unless the something is 0.

    Let's recap

    -you are changing the value of global2 on x2 pressed

    -you are NOT changing the value of green.points on x2 pressed

    • the string displays green.points
    • the value in the string doesn't change, because the value of green.points doesn't change.

    solution:

    either change the value of green.point on x2 pressed.

    or change the value of another variable and have the string display that variable, only using green.points as a number to calculate the value of the new variable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The question is really not that clear.

    All I can do is shoot and hope to hit something, for I don't know what you are reaaly asking.

    Would pinning the buttons to the sprite work?

    If you'd like to resize the buttons the same way as the sprite it would mean calculating the size of the sprite compared to it's original and multiplying your button with that amount.

    so first you would need the sprite's original size.

    setting instance variables for originalwidth and origanalheight before changing it's size would do that.

    to change the button it would look something like this

    button set width - width= (sprite.width/sprite.originalwidth)*button.width

  • Ok so you just want to know how to add 10 degrees every time you click..

    the action should be

    object set angle - angle= object.angle+10

    every time the button is clicked 10 degrees is added to the current angle of the object.

  • If you have the paid version of construct you could add all enemies to a family and check collision with that.

    I don't know how different your enemies are, but you could also choose to attach the enemy to a sprite or vica versa and check the collision on that sprite instead of each diferent enemy.

    Another way would be to have just one enemy-sprite and have all the different enemies be animations of that sprite, which would also mean the on collision-event would just need one object.

    There are many different ways..

    One way of many ways to make the boost temporary would be to give the player timer behaviour and on collision set the timer for a certain amount of time.

    Than on timer you could set the speed back to the original speed..

  • I'm not sure what you mean, but wouldn't creating a global variable and setting it to the name of the layout before changing layouts work?

    so

    on button pushed

    • system set variable Lastlayout = layoutname
    • goto layout - (whatever layout you'd like to go to)

    on button "back to last layout"

    • goto layout - LastLayout
  • forum attachments don't work at the moment, I think..

    You could upload your capx to dropbox or google drive or something and copy the public link..

  • On x2 you are adding 30 points to global2, but you aren't adding points to green.points.

    green.points stays the same so in the string it is still 30.

    one way to solve this is to change green.points the same way you change global2

    another way would be to add a totalpoints variable to green and set it to green.points when button touched and to 2*green.points when x2 touched.

    Instead of using green.points in your string you could use green.totalpoints.

  • if your project is open in C2, just choose save as single file, it will give you a capx file.

  • You should try to explain better what you are trying to do.

    Point is, in the event itself you only reference the girar-object, but in the actions you have the Hbar-object, the IdHbar-object and the UIDToProperties object.

    If any of the objects in the actions have more than one instance on the layout, there is no way for the program to know which one you mean.

  • The basics should be something like this:

    Player on collision with enemy - player die

    player on collision with power up

    • power up destroy
    • player set speed to player.speed+10

    It would be hard to give any more precise info, without knowing how you have your events set up at the moment and what behaviours you are using.

  • Could you please share a capx of the issue, so we don't have to guess where the problem lies?

  • You could just do this by specifying when the angle should be different and what you want the angle to be.

    in normal circumstances:

    every tick set bullet angle - sprite.bullet.angleofmotion

    mouse button left is down - sprite set angle towards position mouse.x, mouse.y