Kan's Forum Posts

  • It's hard to answer without looking at your events... Maybe you could upload the .capx file to Google Drive and give us the link? Or attach a screenshot of your event sheet?

  • The only way I found to do this was to use TiledBackground objects instead of Sprites, and resize the TiledBackground to the size of the loaded image.

  • skunheal nimos100 is right, I had the same issue once, and there is only one collision map which is used by all pathfinding objects.

    For the overlapping issue though, you should check the RTS template that comes with Construct 2, it shows how to keep units in "formation" while they move. (Open Construct, go to File > New, and look for "Template : Real Time Strategy (RTS)")

  • The only way I can see would be to create every sprite at random positions, then check if any sprite is overlapping another one, and if so change one of the sprites' position to another random position until no sprites are overlapping (see attached .capx example file).

  • Adam568 You had just forgotten to check if the tiger is attacking before making it walk. I added the required condition, now it works fine (see capx file).

  • Try the "distance" system expression ( https://www.scirra.com/manual/126/system-expressions )

    distance(x1, y1, x2, y2) Calculate distance between to points

  • Some mobile browsers, especially Safari on iOS, won't let sounds play, especially music, unless the touchscreen is touched.

    If that's an issue with music, I'd try adding music files as sound files in your project and treat them as sounds. Might not work, but I remember I wanted to try that out and haven't got a chance yet.

  • It's obviously the bullet that's moving too fast, so it has the time to collide with two blocks before being destroyed. I tried picking the block nearest to the bullet, or picking the first block that records a collision, but it looks like everything's still going too fast to work out.

    The only other way I could think of with my tired brain was to perpetually detect which block is the lowest on the screen and store its Unique ID (UID), and then make sure the bullet can only destroy the lowest block. This method works in your example file, but it might need to be adapted to your real game, and it might also not work at all then.

  • It works, there is just a mistake in the URL, it's a http, not a https : http://lockegames.com/?shopp_product=paypal-plugin

  • Does it allow unlocking something already present in the game when the transaction is done (without having the player to download something or check their emails) ?

  • Well, it seems that unlike the Mouse object, the Touch object keeps detecting coordinates even when the... well, the "touch" has left the window. This could be a workaround, but it implies that the player will have to be touching/clicking (and not just moving the cursor around).

  • That's cool.

    Personally, since I've learned that sub-events are executed one after the other, I like to separate events - especially functions - into several "steps" to make it more clear. As or variables, I like to give them the shorter yet clearer name possible, and have as little as possible to make it less confusing.

    In the end we both want our code to be simpler for when we (or somebody else) will have to look at it later, we just have different ways of doing it.

  • Well, let me remember... I basically removed a few "every ticks" conditions here and there (and left the events with no condition instead since they'll be processed one after the other in the function call anyway) and removed local variables (see file).

    Also I finally meet someone else who uses the latest stable release, instead of the latest beta.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • codah This is a great way of doing it, thanks. And it seems pretty fast even when going through longer texts.

    I've simplified it a bit and I think that's what I'm gonna be using then. Thank you.

  • : The "find" expression would only return the index of the first occurence of the string inside the text, wouldn't it?

    codah : Thanks... I just looked over those solutions but I don't understand javascript enough to know what I'd be doing. Beside, I think that they only show methods to retrieve the number of times a string occurs in a text, and not the index of every occurence of that string. I might be wrong though, since as I said I don't understand enough of it to know what's really going on in the code.

    Magistross : Thanks, your example works fine. I get that I need to insert the string I'm looking for between the two \w* brackets. But I start being lost the moment I look at the javascript. I'd like to implement in a way so it uses or stores the occurences' indexes it finds instead of showing them to me in an alert message, but I don't know how.