Sumyjkl's Recent Forum Activity

  • Unfortunately I can't open your project, but I'm guessing you mean something like this:

    x = int(object.X/32)*32

    The above will set object to the closest multiple of 32.

    The idea here is that the value, object.X will be divided by the grid size you want, and then rounded up/down or in this case to the closest whole number, then multiplied by the grid size again to get it back to it's proper size. In effect, it rounds to the grid size, since when int() is applied to it at a 32nd the size, it's rounding to 32x the normal size. Or something.

  • Seems to work fine for me. What part didn't work?

  • I used this tutorial: http://yal.cc/hosting-html5-games-on-google-drive/

    And it seemed to work. I think the key is that it has to use the different domain name; googledrive.com, not drive.google.com.

  • Ah good point. Thanks for the tip.

  • I've seen a few topics on the forum marked as popular because the author has replied 50+ times to keep it up the top of the list. In most forums this is spamming, and in some just double-posting is looked down upon. Isn't there some kind of rule for this?

    I don't see anything but the slightly ambiguous word 'spam' in the rather hard to find rules. But common sense and a good idea of what ethics means in most cases makes rules redundant. I'm not trying to be a backseat moderator here, but under my own type of totalitarian rule I'd just merge all the posts into one, and for massively obtrusive repeat offenses lock the thread and warn the user. This kind of stuff can get out of hand, and in the meantime it makes a mockery of the forum's 'most recently replied to thread first' system. It's logically in the same boat as trolling and flame-baiting.

  • Arrays are broken.

    http://i.imgur.com/HOT708n.png?1

    http://i.imgur.com/Pyr3wrI.png

    Turns out, the array needed to be larger than the scope. The array width, height etc. are not zero based. They are the count of the number of entries on that dimension.

    If your array height is 7, try making it 8.

    This worked:

    The capx I used: [mediafire]

  • It sounds as if an else would do this.

    But I'm not sure I understand what you mean.

    Edit: Like this, I mean:

  • There are several ways to do AI for top down games, but it seems most of the time using things like pathfinder adds a whole new level of complexity and bugginess to the game. Namely, pathfinder doesn't care about solids. If it's moving along a path and that path has just become nonviable, it will still get to it's target location. I've considered a slightly more manual approach using an array for lost positions, but that seems a little intensive.

    The idea looks a little like this:

    But for a static world game where nothing ever, ever changes state, pathfinder is probably the easiest option.

    Oops, I think I just answered the wrong question. In terms of telling the AI whether to target you or not, line of sight is quite useful. In terms of roaming around, I have tried using instance variables for the AI to center around, and then it's moderately easy to just pick a position that is not overlapping solids/has line of sight in a random area around the AI.

  • That is odd indeed. Where do you initialize/add stuff to the array?

  • Just as some context, are you doing the for each every tick? I can't imagine any other reason for it being so slow. Literally wherever possible, it is downright necessary to make for each loops only run on triggers or after ensuring you have only picked the right instances / entries first.

  • You mean like this?

    at(x) can also be used at(x,y,z).

    It just points to the x y z coords in the array.

    The manual has some info, and it's not that different to normal programming arrays such as in C++.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've never really used this so it's only theoretical, but couldn't you just use a variable for velocityY that updates at the end of the tick? Then it will always be the tick before the collision. I can't tell if this is what Silverforce is suggesting, but it may work.

Sumyjkl's avatar

Sumyjkl

Member since 16 Mar, 2014

None one is following Sumyjkl yet!

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

13/44
How to earn trophies