Magistross's Recent Forum Activity

  • You can "make" your customers occupy tiles by adding an obstacle to the tilemap at the customers position. If customers move, you will have to make sure the custom obstacle is removed and then added again at the new position. Don't forget that paths must be recalculated as the obstacle map changes.

    rexrainbow's MoveTo is particularly useful to move sprite from one point to another. Check out this demo for inspiration on how you could use it.

  • Even if it's not tile based per say, you could use the behavior with an invisible tilemap so you don't have to overhaul everything.

    You're free to use my plugin however you see fit, I simply wrapped the excellent EasyStarJS library in a C2 behavior. That library itself is under the permissive MIT license, so go ahead and use it!

  • Given the fact that your game looks tile based, you might to take a look at my EasyStar behavior. It might be easier to implement in your particular case.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • SnapX/Y and TileToPositionX/Y return the position in the middle of a particular tile. Depending on where your sprite origin is, you might have to shift the position a bit. e.g. Tilemap.SnapX(Touch.X) - 16

  • There are also expressions that combines both so the final expression doesn't become monstrous.

    On Touch -> Create object at x = Tilemap.SnapX(Touch.X), y = Tilemap.SnapY(Touch.Y)

  • Optimally, HEALTH <= 0 (and any condition filtering the For Each) should go above the For Each.

    If you don't destroy the enemy right away, your only resort would be to use a boolean or another state variable (using AI_STATE <> 11 could be ok too if an AI_STATE doesn't change once dead). "Trigger once" in that context doesn't make much sense, in fact, using a "Trigger once" in a loop is one sure way to get unwanted behavior. As soon as it loops more than once, "Trigger once" get mixed up and make each iteration a "new trigger", thus explaining your problem.

    Also, the "Trigger once" in the collision event is redundant, and you might as well remove it altogether.

  • "Health" has to be a family instance variable. Next, the simplest method would be to add "On created" trigger for each of your enemy.

    Enemy 1 -> On created -> Set Enemy 1 "Health" variable to 10

    Enemy 2 -> On created -> Set Enemy 2 "Health" variable to 20

    ...

    The collision event will now have to look like this :

    Enemies -> On collision with bullet -> Subtract 1 from "Health"

  • mindfaQ pretty much nailed it! I'm not sure if it's an intended behavior or not... however when you know about it, you can combine two RegexMatchAt to fetch capture groups even with the global flag set.

  • Nice addition !

  • It's worth noting that RegexMatchAt behaves differently if the global flag is on or off. If on, the index argument will fetch the n-th match, if off, the index will fetch the n-th capture group (with index 0 being the whole match, index 1 the first capture group, and so on so forth). Haven't found a way to get capture groups yet when using the global flag, except by nesting two RegexMatchAt function calls...

  • This won't quite cut it. The stretching needs to occur on the rotated image, which I believe is impossible to do in vanilla C2. One way to do it would be to use a paster object (plugin by R0J0hound).

    Here, I put the galaxy sprite in a container with a paster. Every frame I refresh the paster sprite by first re-positioning and expanding the drawable area back to the original state, paste the galaxy with a newly rotated state, and then stretch the paster object by an arbitrary factor (< 1 to retract, >1 to expand). Then I position the paster in a manner that it seems to share the sprite origin. Seems to work pretty well !

Magistross's avatar

Magistross

Member since 4 Jul, 2011

Twitter
Magistross has 14 followers

Trophy Case

  • 13-Year Club
  • Entrepreneur Sold something in the asset store
  • 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
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies