jobel's Forum Posts

  • or you could make a trigger..

    Sprite isOnScreen (invert it)

    this will execute whatever actions when there isn't a sprite on the screen. although this doesn't work if you have sprites off screen and you want to count them in your condition.

  • oops I meant PlaybackTime. you can use it any where you can write system expressions..

    Try: System Compare two values

    First Value: Audio.PlaybackTime("tag")

    Second Value: 123

    tag is what you named your audio, and the 123 is number of seconds

  • cool, sounds like an interesting game...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • set the scale to 0.25 to see it in action!

  • figured it out..

    I was starting the TB at x:940y:540... it needs to start at x:1024y:512 since I'm doing all my math with 512...

    WoW... that feels good..

    although I'd like to do away with the dummy TB. I could probably replace it with a calculation or variable as I was just using it visually to see what was going on... it looks interesting to have both TB visible..

  • the IIDs are just the objects number sequentially. 0-to how many you have..

    the UID is the unique number of the object in the entire game..

  • pick random will only pick 1 object. you can combine it with a compare using the Object event itself... no need to use the System event again.

  • make sure the event is OnClicked and not OnMouseButtonDown

  • You could try newts sugestion and just move the background by giving it the bullet behavior and setting its angle of motion to be opposite to the players angle of motion. You then would set its speed to 0.25*player.speed to get the same visual effect a paralex, except on the same layer without the need for coordinate calculations.

    I'm not sure how that would work on an unbound layout. The player also can move 360 degrees. Eventually the player will overtake the TB, then what? I would still need to reset the tile over the player, which is what I am doing now.

    I have it working except for one small glitch. right at the beginning there's a jump... it's somewhere when the calculation starts..

    Here's the latest:

    https://www.dropbox.com/s/wc25q2e3m1vph ... .capx?dl=0

  • okay I think I figured out the problem. compensating with lerp gives a number that is not divisible by 512... so I have to bring it to the nearest multiple of 512...

  • my work around is to make the tiled background 40,000x40,000 and somehow push the player back when they get near the edge -- otherwise it will look really bad if the parallax just ends...

  • R0J0hound I don't understand what the canvastolayer values are.. CanvasToLayerX(layer,x,y) there is no doc on this that I can find. I printed out the values and they don't make any sense..

    I tried your other calc: player.X + (scrollx-layoutwidth/2)*layer_parallexX/100

    but that value doesn't make sense either...

    I'm ready to give up on this... what a pain!

  • R0J0hound thanks, I didn't know about those.. I will look into that! it does seem like there should be an easy way to calculate between parallax layers.. I feel like I'm reinventing the wheel..

  • okay I think I have the Trigger correct (not totally sure).. I'm triggering the infinite scroll to happen when the player reaches the halfway point of the TB (tiledbackground). To compensate for the parallax, I'm calculating where the player would be if it were on the same layer.

    My problem is still with Setting the Position of the TB relative to the player's layer. It feels like I have to do the opposite calculation, but that's not working.

  • sorry, i think you misunderstood. Im using the latest version of Construct 2. But im using the 10.5 node-webkit exporter (since it's a standalone install i can put 10.5 in there) and all is working fine.

    I see.. I didn't think they supported that.. or it wasn't recommended.. which is why it's so hard to find 10.5 (and it's not on the list of downloads)

    I just checked and it seems I have both 10.5 and 12 installed on my system!