How do I create objects with sine behaviour?

0 favourites
  • 8 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • 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

  • 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

  • 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

  • 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.

  • 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.

  • '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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Any ideas on how to achieve this?

    Sorry for spamming.

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