dop2000's Recent Forum Activity

  • Well, if you want the bullet to immediately change angle, you can remove the alnglelerp part.

    Simply set angle to angle(Self.X, Self.Y, Target.X, Target.Y)

    anglelerp was to make the trajectory smoother.

  • Try this:

    Every tick -> BulletSprite set Angle to anglelerp(Self.Angle, angle(Self.X, Self.Y, Target.X, Target.Y), dt*4)

    In Bullet behavior set "Set angle=Yes"

  • What you probably looking for is Else condition.

    If condition A -> action A

    else -> action B

    You can also use other conditions after Else:

    If condition A -> action A

    else if condition B -> action B

    else if condition C -> action C

    else -> action D

    "Else" can't be used with triggered events like "On created" event on your screenshot.

    Triggered events have a little green arrow and usually start with "On.."

    You can see the list of all expression in the expression editor, there is a semi-transparent window with all objects in your project. If you click System for example, you'll find all system expressions.

  • I'm guessing you want to select rotation direction randomly?

    Use choose(0,1) to "flip a coin".

    if choose(0,1)=1 then rotate clockwise

    else rotate counterclockwise

    Or you can use choose() expression in a formula: Rotate (choose(-1,1)*degrees)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No worries!

  • Sorry, I had to change pretty much everything:

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

  • If I understand you correctly, you can try this:

  • RBARON85

    You have to do this in 2 steps:

    Step 1. Pick an instance of the sprite.

    You can use any method to pick an instance:

    Sprite->Pick by unique ID - if you know the UID

    System->Pick random - if you want a random instance

    Sprite->Pick nearest/furthest

    etc.

    Step 2. Move to (Sprite.X, Sprite.Y) position.

    Again, there are plenty of ways to do this. The easiest is MoveTo behavior, or you can use Bullet, LiteTween or simply move your object a couple of pixels towards (Sprite.X, Sprite.Y) on every tick.

    Note: Step 2 should be a sub-event to step 1.

  • Maybe just restart the animation after it has ended?

    Character->On Finished "Speak" Animation -> Character play "Speak" animation

  • facecrime

    No, see my code - you can calculate (time-ButtonSprite.timePressed) to fill up the meter while the button is being held in "Is Touching" event. You can add other conditions, say the meter starts filling up if holding time is more than 1 second, and stops after 3 seconds.

    The same formula can be used when touch is released or after finger has moved away from the button - in "Is NOT Touching" event, before resetting timePressed to 0.

    You don't need another flag, since you have timePressed variable. When it's 0, you know that the button is not in touch.

  • You can try something like this:

    Add an instance variable timePressed to the button sprite.

    Create these events:

    Touch: On touched object ButtonSprite -> ButtonSprite set variable timePressed to (time)
    
    Touch: Is touching object ButtonSprite  
    ButtonSprite: compare variable timePressed not equal 0
                                         // use formula (time-ButtonSprite.timePressed) to get the duration of hold
    
    Touch: Is NOT touching object ButtonSprite 
    ButtonSprite: compare variable timePressed not equal 0 
    System: Trigger once
                                         -> ButtonSprite set variable timePressed to 0
                                        // release the charge based on hold duration
    [/code:1rbwue0c]
  • Kyatric, As I understand from the Java code, Card[] array contains 10 cards. (1-based for simplicity)

    Cards which user owns contain value "1".

    Cards which user doesn't own contain value "0".

    The task is to select a random card which used doesn't own. Basically find a random member of the array with value ="0".

    This can totally be done in C2 without the array and much easier. Pick all cards with instance variable="0", and then pick a random card from them.

    Here is a slightly more accurate example:

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

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 269 followers

Connect with dop2000

Trophy Case

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

29/44
How to earn trophies