Random spawn platforms. Give different speed.

Get help using Construct 2

Post » Tue Apr 16, 2013 11:50 am

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 .

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.
https://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
B
14
S
4
G
1
Posts: 42
Reputation: 1,775

Post » Tue Apr 16, 2013 9:33 pm

set platform speed to random(500) in the end of the "create" event
B
55
S
19
G
8
Posts: 191
Reputation: 8,831

Post » Wed Apr 17, 2013 12:16 am

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
B
14
S
4
G
1
Posts: 42
Reputation: 1,775

Post » Wed Apr 17, 2013 9:48 am

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.

http://imgur.com/a/hh9mW
B
14
S
4
G
1
Posts: 42
Reputation: 1,775

Post » Wed Apr 17, 2013 10:01 am

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

-> Every tick
--> Any pick action like Sprite.InstanceVariable = rand(X)
---> Set speed random(x)

B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Wed Apr 17, 2013 10:36 am

[QUOTE=Darklinki] You need to pick the right instance before. Something like:

-> Every tick
--> Any pick action like Sprite.InstanceVariable = rand(X)
---> Set speed random(x)

[/QUOTE]

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.

http://imgur.com/5f8yuWz

Thank you for the answers. Problem solved.

:)
B
14
S
4
G
1
Posts: 42
Reputation: 1,775

Post » Wed Apr 17, 2013 10:43 am

I'm glad I could help and nice that you posted your solution.
B
15
S
6
G
6
Posts: 512
Reputation: 5,550


Return to How do I....?

Who is online

Users browsing this forum: DemantDigitalArt and 19 guests