Solomon's Recent Forum Activity

  • Thanks for the response. Does that mean I need to get rid of the custom movement behaviour? And why every 0.5 seconds not every tick?

    Edit: Eh I read it again, yep I see spawning an item every 0.5 seconds in positon of X.

    The problem is that with the custom movement I managed to do so, but when I speed up the item speeds up when I slow down the item slows down.

    There is no difference if I add negative value it still doesnt change.

  • I have been thinking about this for about a week now. This actually made me take a brake from Construct but now I'm back at it again and still cant figure it out.

    I have a scrolling background, which is basically set that if I move around it scrolls along with the movement. I can go faster and slower. So the player sprite is standing still only the background is moving.

    Now I would like the randomly spawned items to move in relation to the background and to their position and still have their own movement. So if and sprite/item is moving let us say 10 pixels, when I scroll the background forward it moves less, and I can catch up to it, and when I move back it moves faster, as the combination of my speed is added to its speed. When I - the background is still, the item moves at its own speed only.

    I am getting nowhere with this, I know I have set the bar high for myself, any nudge in the right direction would be greatly appreciated by me.

    In using the custom movement behavior on the background as well as on the spawning sprites/items. I tried pinning them and then also giving them some speed but it doesn't seem that the 2 behaviors work together.

    Thanks.

  • Yes I see, but the idea is that it would be a top-down view of the ground only, just 1 long sprite. So basically you are saying that its better to solve this using tiles then eh?

    Ps. The background sprite would have no animation and be static only.

    EDIT: I was thinking of going with tiling background but that causes problems with scaling in Construct 2, in regards to some tutorials that I have followed.

    P.s. Thanks for the link, good read.

  • I was wondering what is the maximum width in pixels a scene can have, so that it runs smoothly on an average PC and that Construct 2 would be able to handle?

    20 000 pixels? 50 000 pixels? 500 000 pixels?

    There wouldnt be too much sprites I dont think, maybe max 5 per scene with instances, mostly a background that fills the whole scene.

  • Put the toggle hasspawned action above the system create action

    Wha...What kind of magic is this?? You sir are a genius! Thanks it works like a charm now!

  • Well, in this example hasspawned only checks if a sprite has already spawned another sprite, not if it itself is created..

    Ah, ok I get the reasoning behind it, thanks.

    Would something like this work?

    Give the sprite a boolean HasSpawned

    system for each sprite

    sprite is not boolean HasSpawned

    sprite.x < 800

    > system create sprite at (x,y)

    > sprite set boolean spawned to true

    Sadly it doesnt work

    If I add 1 box from the beginning a line just forms of the boxes then they stop.

    If I dont add a box then just 1 box is created.

  • Based on your idea I have something like this:

    On layout start: Set Boolean CanSpawn = false, Create Spriteiqp@X

    IF Sprite.X < 800

    Set CanSpawn = True

    IF CanSpawn = true

    Create Sprite X

    Set CanSpawn = false

    But I would need to store the Sprite.X in an array for each instance and override the 1 value in the array? And that array value for each Sprite.X instance would have to be compared to <800. But how can I store each x for each instance in 1 field and override it? Would it use the For loop?

    For each created instance > store sprite.x array.pos(0,0) ?

    Eh, got mixed up again.

  • Thanks for the reply, I was wondering If the sprite has not spawned yet how can the system check if its x value is lower than 800?

  • What I figured so far, but having problem implementing it in code:

    On Layout Start: Spawn sprite in position(x,y)

    For each spawned sprite

    ___Store sprite.x in array.pos(0,0)

    If array.pos(0,0) < 800

    ___Spawn sprite in position (x,y)

    ___Store recent spawned sprite.x in array.pos(0,0)

    Now the problem is that the x of the sprite is constantly moving at different speeds, I have to track it all the time. I was wondering how to do that?

    Also, how do I store the recent spawned X in the array?

    The sprite has a CustomMovement behaviour.

  • IanHarlow - Families are only available in purchased Construct 2 from what I know.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How would I go about spawning a sprite instance based on the distance in X another sprite instance?

    sprite instance<------------- x distance -------------->another sprite of the same instance<------------- x distance -------------->another sprite of the same instance ...etc..

    Am I right in thinking that I need to make an array and add the x position of the first spawned instance to that array, then compare values, then create another

    instance and add its x position to the array?

    Time to sleep, will think about this tomorrow, in the meantime any help will be appreciated.

    Thanks and goodnight for today.

    Ps. Or maybe using an invisible sensor sprite? Hmm...

    EDIT

    I think would have to track the X position of the instance as it is moving constantly...

  • Yep you are right, SOME people love these kind of game

    But keep going dude, its always better to continuously work on and improve a game than to give up.

Solomon's avatar

Solomon

Member since 22 Aug, 2015

None one is following Solomon yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies