dop2000's Recent Forum Activity

  • I haven't tried it, but another idea would be to save the game before entering the inventory layout. On exiting inventory layout write inventory to Local Storage and load saved game. On "Load Complete" read inventory from local storage.

  • "Set angle=no"

    Enemy->Bullet->Set Angle of Motion To (angle(enemy.x, enemy.y, player.x, player.y))

  • Try Construct 3

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

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

    I just tried "On every tick > Repeat 1000 times > compare distance" and got 60 FPS and only about 5% increase on CPU utilization.

    So unless OP wants to do this check tens of thousands times on every tick, he should be fine.

  • naaah, ur worrying too much my dude! Knock yourself tf out, hell, make 5 underProfile visuals for those NPCs!

    Seriously, it should be fine.

    Don't use "every 0.01s", this is less than 1 frame duration. Use "Every tick" or you can simply pin sprites with animation to your NPCMask sprite.

    Also, it may be easier (less messy) to have different sprites for male, female, child etc. Add them all to a family "NPC" and you can control them all as instances of one object. Different sprites can also save some memory on levels where you don't have all NPC types. But there is nothing wrong in doing this your way (with all animations in one sprite), and there should be no big difference performance wise.

    You can try a stress test before you start making the game - put several animated sprites the size of your NPCs on the layout, add Bullet behavior. Make 40 copies of them, and see what what numbers you'll get for FPS and CPU utilization.

  • There is a setting in Bullet behavior "Set angle", change it to No.

    Use "Bullet Set angle of motion" event to change direction.

  • Matei511

    Not sure why can't you use containers. Anyway, here is a demo with and without the container:

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

    Oh, I see you need to pin multiple instances to one object. Then yes, your method is ok.

  • You can try adding another condition to event 806: Enemy Health>0

    If this doesn't help, add some debug output to event 801, for example Browser->Log "Collision:" & Enemy.UID

    This will tell you how many times the collision happens. It may be possible that when you apply vertical velocity, player collides with the enemy again, or maybe your enemy has some weirdly shaped collision polygon.

  • You can put an invisible tilemap with just one tile type and Solid behavior. Set tiles where your water is on the map and your character will not be able to move there.

  • Why not just use the distance expression?

    distance(sprite.x, sprite.y, player.x, player.y)

  • Short answer - not possible.

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

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 280 followers

Connect with dop2000

Trophy Case

  • 10-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
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies