gnuss's Recent Forum Activity

  • BTW since it's been a request a few times, the next build has an updated Turret movement which can target objects with a nearest-always method (which means if something else comes closer, it'll target that instead) - so it will be able to be used for finding closest objects too.

    Yeah that could be really handy. And if you find time to do it please add destructible terrain

    Never heard of mmf?? Wow.. i thought everyone here was X-mmf-users.

    I knew a little python before I started looking for game creation software, so I googled something like "game making software python" and somehow ended up on scirra.com and I started using construct, so I guess lucky googling kept me from mmf. (good thing cause I really prefer open source)

    Anyways, I guess this is going off topic, and the problem I had is solved, so I'm just gonna.....uh......where is the "mark thread as solved" button?

  • like the captain said, increase the range in the Bullet behavior. Also, it might be better to use Ball behavior and not Bullet behavior in this game if you want the balls to bounce off that thing that follows the mouse. Just remember to set the ball's angle of motion to sprite3.

  • You'd also have to track the targetted object being destroyed, other objects coming closer, etc. etc. I'll give you the events if you want, but I'd recommend the Turret behavior for now.

    That's alright I don't need anything that advanced, and the turret behavior doesn't quite do what I want, but I've managed to solve the problem using a for each condition and storing the target location in private variables. (turns out I used the for each condition wrong the first time I tried )

    It's worth noting the spread value/fastloop pattern is redundant in Construct - always use a For Each instead.

    Good, cause I have no idea what a spread value is I've seen people talk about in some other posts on this forum when talking about mmf, but I had never heard of mmf before I read that post so I don't know much about it.

  • (x2 - x1)^2 + (y2 - y1)^2 = distance^2

    distance = sqrt((x2 - x1)^2 + (y2 - y1)^2)

    My brain hurts after reading that , my math skills are a bit rusty so I had to think about it for a little while, but I do get what you mean. Fortunately my game is so simple it only needs to calculate distance on the x axis, but I'll keep this in mind if I need it later on.

    I have another problem though, I want to add more orange boxes, and have each orange box choose the purple box closest to them.

    <img src="http://farm3.static.flickr.com/2411/2427819224_0a235ec3a0.jpg?v=0">

    How do I make each orange box choose their own closest purple box? Needless to say, the solution with a distance variabel with the value abs(player.x-enemy.x) only seems to work with one player. I tried experimenting with the for each condition but it got me nowhere.

    Any help is appreciated!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think it might be 'absolute' Abs(value).

    This does the trick!

    abs(player.x-enemy.x) works perfectly!

    Thanks guys!

  • Thanks for the answer

    I tried simply setting "distance" to player.x-enemy.x

    and then "pick with lowest variable".

    This causes one problem though, if one of the enemy instances are to the left of the player, the value "distance" will be a negative value (like -200), and will therefore always be picked before a positive value (like 100).

    see here for example cap: http://www.mediafire.com/?byy26uv0ybn

    Is there a way to do this that I have missed? Or perhaps a way to change negative values into positive values?

  • I'm having some trouble trying to figure out how to make my player object pick the closest instance of another object.

    <img src="http://farm3.static.flickr.com/2287/2425640857_df5752fc31.jpg?v=0">

    I want the orange box (the player) to move to the closest purple box. I have made all the events to make it move of course, but I can't figure out how to make the player actually pick the closest purple box. Any bright ideas guys?

  • Yeah that makes sense

  • What's the difference between "Has LOS to object" and "On object in LOS"?

  • It works fine for me, I'm not getting any crashes.

    I forgot to add a behavior to the sprite

    If you try adding a behavior to the sprite called "unit", does it still work fine?

  • I'm trying to make a "selection box thing" like in lemmings. I added a "Pick random" event to make sure only one unit is chosen if the "selection box thingy" overlaps two units at the same time. This crashes my game, but ONLY if the units have a behavior. If the units do not have a behavior it works perfectly. I'm not sure if this is a bug though or if it's just me doing something wrong.

    Here's the cap: http://www.mediafire.com/?yznml0wdew1

    EDIT: This cap is without behavior added, try adding a behavior to the sprite called "unit" (any behavior will do I think) and it should crash.

  • Thanks to everyone for their answers But I haven't quite figured out how to do this yet. I ran into some problems with the canvas, since I'm using platform movement as well. If a sprite with platform movement is placed on top of a canvas object with the solid attribute, the sprite will treat the entire canvas object as solid, not only the non-transparent pixels. So the sprite will be standing in thin air.

    (or maybe I have misunderstood how you're supposed to use the canvas, that is also a very real possibility )

    AS for JayJay and Casho's suggestions (thanks for the .cap ), this method seems to be working, but I'm worried about how much resources this would use on a large scale? It could easily be several thousand sprites. I'm worried that would give performance problems, but I'm not sure, does anyone know how many sprites are too many?

    As for using a mask I'm pretty clueless on how I would actually do that in Construct?

    Any help is appreciated

gnuss's avatar

gnuss

Member since 12 Mar, 2008

None one is following gnuss yet!

Trophy Case

  • 16-Year Club
  • Email Verified

Progress

17/44
How to earn trophies