How do I create objects with sine behaviour?

Get help using Construct 2

Post » Sat Oct 15, 2016 6:53 pm

For some reason trying to create an object with a simple behaviour doesnt work.
On my capx you can see that there´s alredy a platform with the sine behaviour that i want working on top of the screen.
However when my "code" comes into action to create a new platform object with the same sine behaviour it comes all deformed and i cant seem to understand why.
Any ideas would be appreciated.
Thanks alot.
https://www.dropbox.com/s/5wqwmn6sk8pzg ... aproj?dl=0
B
26
S
14
G
8
Posts: 49
Reputation: 6,250

Post » Sat Oct 15, 2016 9:44 pm

I'd be happy to help you, but you need to provide us with a .capx not a .caproj

You can do so by going to "file" -> "Save as" -> Select .capx as filetype -> save -> upload -> share link
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Sat Oct 15, 2016 11:14 pm

Ok thanks alot and sorry im still a bit new to the whole dropbox concept
Heres the capx.
https://www.dropbox.com/s/m8pcly3przdw7 ... .capx?dl=0
B
26
S
14
G
8
Posts: 49
Reputation: 6,250

Post » Sun Oct 16, 2016 10:42 am

This logic creates 60 sprites (on the same place), then destroys them and starts over. All 60 have a correct sine behaviour. So , to answer your question: there is no problem regarding the creation of a sprite with a behaviour.

I do understand that there is a flaw in the logic. It does not do what you aim to do.
I dont really understand what exactly you want to do. Please tell. Ty.
B
33
S
18
G
28
Posts: 2,474
Reputation: 20,912

Post » Sun Oct 16, 2016 1:05 pm

I want to create the same object that is alredy running at the top of the layout with the exact same behaviour.
Currently the one at the top is moving to the left and right, but the one that is created looks like it stretches first to the right and then to the left...I dont know if i am making myself clear...but basically all i want is to be able to create objects that went created have the horizontal sine behaviour...
Thanks for the answer.
B
26
S
14
G
8
Posts: 49
Reputation: 6,250

Post » Sun Oct 16, 2016 6:07 pm

'but the one that is created looks like it stretches first to the right and then to the left'

Uhh no, you had 60 sprites on top of each other, it just looked that way.

Here you go.

https://www.dropbox.com/s/m4eqs1p3tzhm1 ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,474
Reputation: 20,912

Post » Sun Oct 16, 2016 8:16 pm

Hm...i see thats what i wanted alright.
Thanks.
But theres a problem...
I wanted to managed the creation of the platforms through a global variable.
My idea is to have a global variable that controls the creation of several types of platforms as the player progress through the game.
Every time the player would reach the end of the layout, the global variable would choose between a certain amount of numbers(1,2,3,4 and so on) and depending on what it picked it would create one instance of the corresponding platform.
Say it picked 1, it would create one platform with the horizontal sine behaviour at a certain location on the layout.
If it picked 2, it would create only one instance of another platform with its corresponding behaviour...and so on.
I´m not sure if im making myself understandable but that´s basically what i was aiming for.
B
26
S
14
G
8
Posts: 49
Reputation: 6,250

Post » Mon Oct 17, 2016 10:49 am

Any ideas on how to achieve this?
Sorry for spamming.
B
26
S
14
G
8
Posts: 49
Reputation: 6,250


Return to How do I....?

Who is online

Users browsing this forum: alextro, stevenode and 4 guests