dop2000's Recent Forum Activity

  • If you add Black and Red sprites to the same container, then they will exist in pairs. You will be able to simply do "Pin Black to Red".

    If you don't want to use container, try this code:

    System-> For x=0 to Red.count-1
       System -> Pick Nth instance of Red instance=loopindex
          System -> Pick Nth instance of Black instance=loopindex   :   Black pin to Red
    [/code:34g0bdhh]
    
    In both cases sprites will be pinned to each other in the order they were created. Black sprite with lowest UID - to Red with lowest UID and so on.
  • I'm not sure I understand.. Could you share you capx? (you can PM it to me)

    Or create a small project that demonstrates the problem?

    By the way, if I'm not mistaken, screen center on a layer with parallax 100,100 is always at (scrollx, scrolly)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is how you can do this in one action:

    Set FlipGravity to (FlipGravity=0)

  • I found a few posts that could help:

    Edit: this is how you convert coordinates from layer 1 to layer 0 (when sprite located on layer1):

    CanvasToLayerX("Layer 0",LayerToCanvasX("Layer 1", sprite.X, sprite.Y) ,LayerToCanvasY("Layer 1", sprite.X, sprite.Y))

    CanvasToLayerY("Layer 0",LayerToCanvasX("Layer 1", sprite.X, sprite.Y) ,LayerToCanvasY("Layer 1", sprite.X, sprite.Y))

    For example, to fire a bullet from gun on layer 2 at player on layer 1:

    Create object Bullet on layer 1,

    set X to CanvasToLayerX(1, LayerToCanvasX(2, Gun.X, Gun.Y), LayerToCanvasY(2, Gun.X, Gun.Y))

    set Y to CanvasToLayerY(1, LayerToCanvasX(2, Gun.X, Gun.Y), LayerToCanvasY(2, Gun.X, Gun.Y))

    Set Bullet angle of motion to angle(bullet.X, bullet.Y, Player.X, Player.Y)

  • There are only a few expressions in C2 related to scrolling - ScrollX, ScrollY, LayerParallaxX and LayerParallaxY.

    And, as far as I know, there is no such thing as scroll rate.

    I'm not sure how any of those can be related to "overlapping on offset" (there is no "collision at offset" either).

    Are the objects that you need to check for overlapping located on layers with different parallax setting?

  • I'm not a big fan of arrays in C2. I repeat this almost in every post where arrays are mentioned <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    I'm convinced that many things can be done much easier with objects and instance variables instead of arrays.

    Anyway, here is a demo where cards are moved like you want. I used an example from your other post, modified and simplified it (by removing arrays <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> )

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

    You will need MoveTo addon to open it. It's a great behavior and I highly recommend installing it.

    If you change "order by" to spCard.cardFace in event 10, then cards in hand will be arranged by their suit and value.

  • Yes.

  • If you rotate 90 degrees, check LoS and rotate back (all in one event), this will not interfere with any other LoS checks.

  • Animations, many system events and behaviors are automatically adjusting their speed to fps, they are already using dt for this.

    Same animation on 60fps and 30fps PCs should take the same time (ideally), "Every 1 second" event should take 1 second, bullet with speed 1000 will cover 1000px etc.

    If your second PC is so slow and laggy that C2 engine can't compensate it, then you will not be able to do this with dt either.

    Normally you only need to use dt when you are controlling objects with events, like moving a sprite every x pixels every tick, or scaling/scrolling the view.

    Edit: I did some testing, looks like dt can't be bigger than 0.0333. So if fps is below 30, the dt will still be 0.0333 and the game will run slow. You can't fix this with dt, because the actual frame duration is longer than 0.033

    Maybe you can do this by getting system time with JS or some addon..

    I have a powerful ultrabook with Windows 10 which I'm only using for about a month.

    C2 was working fine at first, but seems like it's getting slower and slower with each day. It sometimes takes about a minute to load, all dialogs are opening 1-2 seconds, interface elements are redrawing painfully slowly. And I'm not talking about big projects, it works like that even with blank projects. I don't know if windows updates are causing this or something else, but it's pretty annoying...

    And, like many others mentioned, there are no such issues on my two older laptops running Windows 8 and Windows 7.

  • CMuskett

    This is most probably caused by collision polygons or origin points.

    Use a different invisible sprite with Platform behavior and pin your character to it. There was a similar post just 2 days ago:

  • You can simply rotate your object with LoS 90 or 180 degrees, check LoS, then rotate back, all in one tick.

dop2000's avatar

dop2000

Online Now

Member since 26 May, 2016
Last online 31 Jan, 2025

Twitter
dop2000 has 257 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies