dop2000's Recent Forum Activity

  • You know, at some point you're going to need to write a demo for how to add credits to a game

    :)

    You can manually place the camera sprite above the player on each layout. Or add this action:

    On start of layout -> Camera set position to Player.x, Player.y-250

  • You need to rename the animations in B1Who2 sprite. For example, where the puppy is playing with the butterflies, the animation should be "PuppyButterflies".

    Other small issues - on "the brown puppy" text, fix the value in the Who variable, it says "Pupply". And you have two copies of B1When2 sprite for some reason.

  • Web font takes some time to load (about 1 second at most). I don't know why you need to refresh the layout though.

    What I did in my game - I placed a text object with just a dot "." on the Loader layout and hid it behind the logo sprite. So when the loader layout starts it load the webfont for this text. And then, when my next layout starts, the webfont is already cached and appears immediately.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, you can't just copy-paste my code into your project and expect it to work.. First, you need to load the JSON data into the array. And in your array player position is at index 2.

  • I may be wrong, but I think you can simply configure "Privacy Policy" and "Location to show user consent dialog" settings on the Mobile ADs plugin, and that's it. The dialog will be automatically shown to users from the EU, and if they don't give their consent, they will be served non-personalized ads.

  • Ok, forget about ternary operator. With the goalkeeper, 3-4-3 formation:

    For "n"=0 to 10
    
     If loopindex=0 : Array set "GK" at X=loopindex, Y=..
    
     Else If loopindex<4 : Array set "DF" at X=loopindex, Y=..
    
     Else If loopindex<8 : Array set "MD" at X=loopindex, Y=..
    
     Else : Array set "AT" at X=loopindex, Y=..
    
    
  • You are probably overwriting the name, check your code.

    3-4-3 is first 3 players are "DF", next 4 players are "MD", and next 3 players are "AT", right?

    So if you are looping from index 0 to 9, loopindex<3 are "DF". You can use a short version of if-then-else for this, it's called ternary operator:

    loopindex<3 ? "DF" : "something else"

    And then nest another ternary operator inside:

    (loopindex<3 ? "DF" : (loopindex<7 ? "MD" : "AT"))

  • Just change the expression. For 3-4-3 it will be (loopindex<3?"DF":loopindex<7?"MD":"AT")

    Or you can do it the long way with several sub-events:

    If loopindex<3 : Array set... "DF"
    Else If loopindex<7 : Array set... "MD"
    Else : Array set... "MD"
    
  • Check out the "Blend modes" template in C3. You can put the color wheel and the mask sprite on a separate layer, set "Force own texture=yes" and they will not affect other layers.

  • Ok, I tried it. But it doesn't sort the array of players, it simply assigns different positions to the first 11 players. So player #4 for example, can be DF in formation 5-3-2. But the same player #4 will become MD in formation 3-4-3. The remaining 7 players are not used at all.

    If this is what you want, then it's very easy. For formation 5-3-2:

    Repeat 10 times: 
    Array set (loopindex<5?"DF":loopindex<8?"MD":"AT") at x=loopindex, y=1
    
  • So you want to "toss a coin" and if it's "heads", then you run the function, correct?

    The easiest way is to use condition choose(0,1)=1

    If you need a 20% chance for example, then use random(100)<20

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