Random spawn platforms. Give different speed.

0 favourites
  • 7 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Hello everyone,

    I usually don't post anything because there a lots of info in the forums but this time my brain got an overflow <img src="smileys/smiley11.gif" border="0" align="middle" /> .

    My game is like DoodleJump and there is a random spawn of platforms. Platforms that are in a family(there are 3 types of platforms).

    Two of them are moving on the X, left and right.

    Here you can test the game.

    dl.dropboxusercontent.com/u/7290053/Ayuda%20en%20accion/index.html

    Now my problem is that I want to move the platforms with a random speed. I tried with different methods but they didn't work.

    I don't want to put my "code" because now it's a mess of tries.

    I would like to hear some fresh ideas for open my mind because now I am kind of blocked.

    If someone need more explanation that how my game is working I will explain without problem.

    I would like to apologize for my grammar because English is not my main language.

    Thanks in advice,

    Peret

  • set platform speed to random(500) in the end of the "create" event

  • I got an update group that "Every tick" and a function of the platforms moving.

    And if I change the speed, every platform moves at the same speed. Because updates all the platforms speed :(.

    Tomorrow I will upload something for explain my problems.

    Thanks for taking your time Kurz

  • I will try to explain a bit more.

    I got an instance variables on the family Plataformas which is SpeedPlatform.

    The basic problem is that the functions are in every tick and if I change the SpeedPlatform after I create the platform, all my platforms change their speed.

    I don't know how to do it.

    Here are a few images of what I am saying.

    imgur.com/a/hh9mW

  • You need to pick the right instance before. Something like:

    -> Every tick

    --> Any pick action like Sprite.InstanceVariable = rand(X)

    ---> Set speed random(x)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to pick the right instance before. Something like:

    -> Every tick

    --> Any pick action like Sprite.InstanceVariable = rand(X)

    ---> Set speed random(x)

    Your answer made me thing that I was already doing this but then I look which instance variable was using in the function.

    I found that I was using the family instance variable speed and not the object in it.

    Here is the problem and the solution.

    imgur.com/5f8yuWz

    Thank you for the answers. Problem solved.

    :)

  • I'm glad I could help and nice that you posted your solution.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)