ImPrettyFamous's Forum Posts

  • Hey Beta7 :)

    Off the top of my head, the best way I'd tackle this is through an array!

    I made a little tutorial Capx for you!

    Whenever a racer crosses the finish line, their name will be added to the array. Once the race is finished, it displays the leaderboard :).

    Obviously, the first car to finish the race is added at #1, the second car at #2, etc. which sounds like what you want?

    You can check it out here!

    dropbox.com/scl/fi/floxg7rdlxlnnk8n6on2e/Racer-Tutorial.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am aware of the Mobile IAP manual; for those of you who need it:

    construct.net/en/make-games/manuals/construct-3/plugin-reference/mobile-iap

  • Hey Construct 3 community :)

    This isn't a 'how-to' question per se, but has anyone ever implemented a battle pass, or any other kind of live-service features into their Construct game?

    I've tried hunting through the forum, but couldn't find anything related.

    While I'm not planning to add a battle pass to my mobile-game, I am planning on adding a "store," with products that cycle daily. It's going to be a couple of months before I start tackling this, but if anyone has done this before and has general tips, or can share issues they ran into, I'd love to hear them!

  • Like, attaching the "cord" to the player? That's the effect you're talking about?

  • This looks really good! And a huge saver of time, lol

  • Hello guys.

    It’s been a long time I’m using construct to create prototype and little Games, and I’m facing a huge problem.

    As a graphical designer I’m not a developer. But I work with them from 17 years and I learnt a lot about coding, thanks to them.

    Using Unity for 10 years I understand a big things. When we create a game it’s really usefull to have independant elements. So we can create a game controller for our player and use it on différent project.

    Or we can create a behaviour for one enemy and use it on other ones.

    If I’m right it’s called « class ». And I’m not sure it exists on construct. So when I create a game on construct, each time I have to recreate players, enemys, bonuses…

    Is someone can helps me?

    Thanks you ^^

    I think your best bet would be to work with "Families". You can make an enemy family, for example, and through the event sheet, specify how the enemy will interact with the game. Any object you place in the Enemy Family will adopt the family's behaviors.

    You'll need to make an Enemy Family for each game/project you want to re-use the logic for. Then, you should be able to just copy and paste whatever code you have.

    So rather than having an enemy sprite -> on collision with a player sprite, for example (which can only be copied onto other projects with the same sprite names and behaviors), you can get around this a little easier with families.

  • I don't know the specifics of your game, but you could try adding an invisible sprite to whichever corners you want to be climbable.

    When the character is colliding with the sprite, it can trigger your climbing animation (or whatever you need).

  • I'm surprised you can select the local var in the second event. Usually it would be out of scope. So the local var being used here is probably set to 0 is my guess.

    Try the same logic with global variables, is it fixed ?

    It was actually just an order issue, it seems. The resolution was: changing the condition from 'On Start of Layout,' to on "Spinning animation."

    The logic worked, but for whatever reason, after it would check if the song was successful, it would default back to its original value by the time the spinner started spinning. Not sure why. I didn't have any other code that changed the local variable value, soo it was a real head-stumper. But I got it fixed and working :) thanks for the reply!

  • Hello, lionz

    Are you the one who always negatively evaluated my posts? I noticed a long time ago in which topics we answer together, I always get a minus in karma. Do you have a problem with this?

    I gave you a thumbs up, because this was funny LOL

  • I definitely think the amount of objects is the issue. Are they tiles because you can own certain parts of the country (as opposed to owning the entire country)?

    If not, you could make each country an object (white), and change its color via the event sheet? That way you don't need a separate object for each color varation? You'd have 195 objects (which is still quite a lot imo), but it'd be a lot better than 40,000!

  • Hello!

    I attached an image, so you guys can visually see what I'm trying to accomplish.

    My game is a music career simulator; for this particular context, the player selects the songwriting studio they wish to record in -- each studio has a varying level of success (i.e. the cheapest studio has a 40% success rate), and they complete the mini-game. Afterward, they are taken to this Summary Layout which'll show their score, and check if the songwriting session was successful or not.

    I have a Spin Wheel sprite, with "Yes", "No", and "Spinning" animations. The "Yes" animation will, obviously, cause the spinner to land on a "Yes" square, and vice versa.

    I thought the simplest way to accomplish this would be to set a local variable (called "Decider"), and compare against the "studioNum" value.

    //I first set Decider to a number between 1 and 100.

    On Start of Layout -> set Decider to int(random(1,100))

    //Then, I compare...

    On animation "Spinning" finished -> If studioNum <= Decider -> set animation to "Yes"; Else -> set animation to "No";

    For whatever reason, this logic doesn't work?

    I tried adding another local variable (a boolean), called "isSongSuccess". Then, I tweaked my logic...

    On Start of Layout -> set Decider to int(random(1,100))

    And added some Javascript...(along with some debugging)

    const ranNum = localVars.Decider; const studioNum = localVars.StudioNum; let isTrue = localVars.IsSongSuccess; const debugText = runtime.objects.Text_Debug.getFirstInstance(); if (studioNum <= ranNum) { isTrue = true; debugText.text = `${studioNum} < ${ranNum} ${isTrue}`; } else { isTrue = false; debugText.text = `${studioNum} < ${ranNum} ${isTrue}`;; }

    Knowing the boolean accurately displays true or false, I then tried using the boolean result to try and set the animation...

    isSongSuccess True -> set animation to "Yes"; isSongSuccess False -> set animation to "No";

    Yet still, it does not seem to work?? In the picture, you can see my debugging text at the bottom of the screenshot. The spin wheel SHOULD have played the "Yes" animation, but instead, it played the "No" animation.

    Any help would be appreciated!

  • R0J0hound, got it. So it seems like I need to rework my logic a little bit. Thanks for the insight!

  • Hey gang!

    So, I've gotten a pretty good handle on integrating simple JavaScript functions into my project. I'm now trying to use JavaScript in conjunction with an Array I have in my project...

    Here's what's going down:

    I have an array (ARR_SongRelease) that stores generated songs: X[0] = Artist Name, X[1] = Song Name, X[2] = Streams Generated For That Song. Whenever a new song is generated in the game, it adds a new entry on the Array's 'Y' access. The array is saved in local storage! This all works great :)

    However, I'm trying to display the top 15 songs (based on the Streams, or X[2] value).

    Here is what my main.js function is looking like:

    And here is what's happening in the event sheet:

    From a little bit of debugging, I've concluded that the issue has something to do with how ARR_SongRelease is being requested, because the code works perfectly fine in VS Codium using a test array. I'm wondering if I have a simple syntax issue somewhere (as I've never tried to call upon a Construct array in JS before), or if the issue is deeper, like my Local Storage, and it's trying to run this function before the data from the Array is even loaded?

    Any and all help would be greatly appreciated :)

  • You do not have permission to view this post

  • tarek2 wow, after years of Construct...I had absolutely no idea you could do that. What a brain bender...

    Thanks for all your help; you saved the day! Arrays are kind of an intense animal for me, I was struggling with this for days. I totally appreciate the examples and help you gave!!!