dop2000's Recent Forum Activity

  • It's hard to find the exact formula, because your numbers are pretty much random, this is the closest I could make:

    spawn_rate = (200+speed)/speed

    You can add clamp((200+speed)/speed, 0.5, 15) to set minimum and maximum spawn rates.

  • I think "Array contains value" scans the entire array, you should not use it inside the loop. Try this:

    For each XY element
     Array Value at (Array.curX, Array.curY)=KeySlots.UIDofDoor 
     ---> Array delete index Array.curX
    

    You can also do this with normal "For" loop:

    For "x" from 0 to array.width-1
     Array Value at (loopindex, 1)=KeySlots.UIDofDoor 
     ---> Array delete index loopindex
    
  • I suggest doing this with MoveTo addon. Bullet is more suited for "shoot and forget" tasks. When you need to move object from one point to another predictably, with acceleration/deceleration, MoveTo is a much better choice.

  • tarek2

    Yeah, sorry, I realized my mistake and updated my post, but you had already commented on it :)

    .

    Yes, the "Else" will not run if at least one picked instance has Class & "_AtKR" animation. So the event should probably look like this:

    Pick AdventurerSprite with animation NOT EQUAL to Class&"_AtKR" 
    -> AdventurerSprite set animation Class&"_AtKR"
    
  • tarek2, I believe the "Else" event will be executed is there are no instances of AdventurerSprite (picked by parent events) with animation Class & "_AtKR".

  • The first "Pick Adventurer where distance..." condition here is wrong. You haven't picked an enemy yet, so you are comparing distance to only one enemy instance (first instance with IID=0, which could be on the other end of the layout).

    I suggest you use "for each" loop:

    Adventurer state not equal "inCombat"
    For each Adventurer
     Enemy pick nearest to Adventurer
     System Is between values: distance(enemy.x, enemy.y, adventurer.x, adventurer.y) between 60 and 500
     ----> Adventurer set state "inCombat"
    

    .

    If you have lots (hundreds) of enemies and adventurers, calculating distances between them may be a bit slow. In this case you can use Line Of Sight behavior - it works faster than distance() expression.

  • On mouse click
    Ball NOT overlapping Wall at offset X:-20, Y:-20
    Ball NOT overlapping Wall at offset X:20, Y:20
     (all the sub-events here)
    

    Clicks will be ignored if ball is within 20 px of the wall on either side.

  • Would I be able to use break loop instead of the comparison, too?

    Yes, you can use "break" - add a sub-event in the loop, in this sub-event check if loopindex>1000, then break loop. But it's easier just to add this condition to the While loop itself.

    Also, since I'd like to have it happen on start of layout, cant this also be done in a single pass?

    You mean add two cells in one loop? Yes, it's possible:

  • You can add additional conditions to "On mouse click" event to ignore clicks when the ball is too close to the walls. One way of doing this is with inverted "overlapping at offset" event.

  • There are lots of behaviors that can move sprites. For your situation (move to a point, then stop), I recommend MoveTo addon.

    You can also move without any behaviors:

    On every tick
     Sprite compare Y > 0 : Sprite set Y to (Self.Y-100*dt)
    

    where "100" is the speed (pixels per second)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The same way you add all other objects - double-click empty space on the layout and select Touch from the list of available object types.

  • You can pin everything on this layer to some invisible sprite and then just move that sprite. Use families to decrease the number of events.

    There is also an addon called "Layer" by Rexrainbow that allows some layer transitions (fade, scale, rotate), but unfortunately you can't move the layer with it..

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 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