Sushin's Recent Forum Activity

  • If I have a game where I want to put a lot of decals around that I want to keep, like blood spatters or bullet holes, I know that using the sprite object wouldn't be the best idea because sprites support animation and have a ton of editable properties. A lot of sprites would simply lag the game, even if they aren't doing anything, so my question is, is there any other object type I can use for this purpose? Programs like flash have multiple subclasses for images depending on what you use them for, like a non-animating "graphic" vs a animated "movie clip" but construct only has really advanced and specific object types it seems.

    I was wondering if using the tiled background as an image would be better than a sprite, or even a 9-patch, or somehow rig the sprite font to be a decal, or is that even worse?

  • Could you put it on it's own layer, and rotate that?No. They simply cannot rotate what-so-ever.

  • Sushin did you find any workarounds? thxNope. The only solution is to not use 9 patch.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure if I understand you right. But if so, then you have to calculate the angle FROM the enemy TO the player, not the other way round.

    Scenario:

    Player is at (100, 100) with a zone of radius 50. Enemy is at (250, 50)

    Now the angle from the player's perspective to the enemy would be ~341.57?. But the angle you need is the one from the enemy's perspective to the player, which is ~161.57

    The rule is that the first pair of coordinates in the angle expression has to be the one of whose perspective you're trying to get the angle.

    angle(playerXY, enemyXY) => the angle that points towards the enemy

    angle(enemyXY, playerXY) => the angle that points towards the player

    But that's not all in this case. You also want to move the enemy from its current position to the proximity zone of the player, which in this case is a 50 pixel radius around the player. So you have to SUBTRACT that radius from the total distance between enemy and player.

    The enemy calculation would then look something like that:

    self.x + cos(angle(self.x, self.y, player.X, player.y)) * (distance(self.x, self,y, player.x, player.y) - 50)

    self.y + sin(angle(self.x, self.y, player.X, player.y)) * (distance(self.x, self,y, player.x, player.y) - 50)

    You would need to replace 50 by the correct radius.

    Works like a charm! Thanks a ton.

  • Good to see you're solved your problem by yourself. But, as I made such an effort to draw such a nice graphic, I will post a more general info that also takes into account the diameter of the ring.

    <img src="https://dl.dropboxusercontent.com/u/11182740/construct/donut.png" border="0" />

    c = center

    a = angle

    r = radius to outer boundary

    r' = radius to inner boundary

    p = new point within destination zone

    d = distance from r' to p

    a = random(360?)

    d = random(r - r')

    p.x = c.x + cos(a) * (r' + d)

    p.y = c.y + sin(a) * (r' + d)

    That's a nice graph. It helps me understand what's going on a little more, but I'm actually having a problem with something else now.

    I'm trying to make the enemy go to an area that is around the player based on their current position, so if the enemy is too close to the player, he will back off. If he's too far, he gets closer. Basically, I want the enemy to move into the area around the circle by moving to and from the angle direction between the player and the enemy.

    This is what I have but it's not quite working. The angle is off-set at a weird spot. <img src="http://puu.sh/4gSoq.png" border="0" /> I'd appreciate your help a second time.

  • ...No. It wouldn't work that way. Anyways, I found the math. Here is the solution for anyone with a similar problem.

    <img src="http://puu.sh/4gNw9.png" border="0" />

    If you set "Patrol Area" to a random positive number, it will go to a random circular point that as far away from the object as that random number is.

  • Hi guys. I'm trying to make a natural looking patrol point for my AI but I really don't know the math I should be using. Here's what the area will look like.

    <img src="http://puu.sh/4gCX3.png" border="0" />

    I know it will involve a maximum radius and a minimum radius but I really don't know how I could designate a point within that.

  • No but I was thinking about putting ads in future games.

  • So far I've been posting my games to Newgrounds, Kongregate and GameJolt and they get decent views, with the most views always being on Newgrounds due to the judgement system.

    But what other notable sites are there to submit html games to?

    Specifically i'm looking for user submission sites but I'm also interested in non-user submission.

    I don't know many that haven't made the leap from flash games to html and unity games yet. There's a TON of flash game sites.

  • All I can say is just stretch it.. BIG TIME. That's what I do, and it's the only way that has proved successful (because it's the only one I've tried and it works! [I use scale outer if that helps deciding on a future method.])

    This seems to only be a problem when scale outer is being used.

    Another problem is that I'm trying to center some text on the screen, but it just doesn't work since I'm using window width.

  • nother bump..

  • one more bump

Sushin's avatar

Sushin

Member since 28 Feb, 2013

None one is following Sushin yet!

Connect with Sushin