Setti's Forum Posts

  • 4 posts
  • You have to take the objects width into account.

    Like:

    X= platform3.ImagePointX (0) + Object.Width + 655

    Thanks for your help gumshoe2029 and it is working now, but how do we generate random objects here we are using platform3, but i want to randomize these platforms and they are of different widths..as i am using free edition, i kept these platforms i should do using animation sprite sheet, but what would be my event and condition for that case...

  • Hi Condolent,

    I have just tried this imagepoint as you suggested and it worked fine for me thanks for that, but i have another problem..

    I want my ball to jump from one platform to other platform and these platforms are of different widths, but I want these platforms to spawn with equal distance (irrespective of their widths)..Can't attach my capx because this is my second post..so here is what i did

    GLOBAL VARIABLE platformspeed= 300

    System every tick --------platform.X - platformspeed * dt

    platform1.X - platformspeed * dt

    platform2.X - platformspeed * dt

    Player Set x to 500

    So my platforms are moving and I gave Platform behaviour for my Player and Solid behaviour for the base. I don't want the player to move left/right so I kept X of Player to 500 every tick..

    So for spawning platforms /base I wrote

    System Every 2 seconds -- System create object platform1

    X= platform3.ImagePointX (0) + 655

    Y= 600

    So by this, I was able to spawn platform 1 after platform 3, but basically what I need is

    1. I want to spawn random objects not platform 1 or platform 2 etc..

    2. I want them to spawn at equal spacing, (but each platform widths are different)

    I'm using free editon of construct 2, so i can't use families here..so any suggestion?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    I'm new to construct2 and programming.. I'hve been trying to get a simple logic to work.

    I want my ball to jump from one platform to other platform and these platforms are of different widths, but I want these platforms to spawn with equal distance (irrespective of their widths)..Can't attach my capx because this is my second post..so here is what i did

    GLOBAL VARIABLE platformspeed= 300

    System every tick --------platform.X - platformspeed * dt

    platform1.X - platformspeed * dt

    platform2.X - platformspeed * dt

    Player Set x to 500

    So my platforms are moving and I gave Platform behaviour for my Player and Solid behaviour for the base. I don't want the player to move left/right so I kept X of Player to 500 every tick..

    So for spawning platforms /base I wrote

    System Every 2 seconds -- System create object platform1

    X= platform3.ImagePointX (0) + 655

    Y= 600

    So by this, I was able to spawn platform 1 after platform 3, but basically what I need is

    1. I want to spawn random objects not platform 1 or platform 2 etc..

    2. I want them to spawn at equal spacing, (but each platform widths are different)

    3. Right Now using every 2 seconds for spawning, but if I increase the value of global variable from 300, i'm sure that every 2 second won't work properly...so should I write something instead of that every 2 seconds?.

  • HI toby,

    I have got the same issue and i was looking to reset my timer..could you help me out on this..

  • 4 posts