jobel's Recent Forum Activity

  • it's under System Event

    but if you don't know what an Every Tick event is, you need to do a couple of the beginner tutorials so you fully understand what it is.

  • liquidmetal wow, cool.. I had no idea that it was from Magic. Weird that they don't mention that on the site.. maybe because it was as you said "oh-so-hated"?

  • pin the gun (position only) and in an Every Tick event do: Gun set angle toward position Mouse.X Mouse.Y

  • okay so these..

    \d Any digit character

    \w An alphanumeric character (“word character”)

    \s Any whitespace character (space, tab, newline, and similar)

    \D A character that is not a digit

    \W A nonalphanumeric character

    \S A nonwhitespace character

    . Any character except for newline

  • RegExr is an online tool to learn, build, & test Regular Expressions(RegEx / RegExp).

    oh it's not js? it is it's own thing? well it's a standard I know nothing about, so good to know!

  • What?

    Google "regex" will give you more results than you ever can read...

    http://eloquentjavascript.net/09_regexp.html

    oh javascript.. that was not clear. I'm a C/C++ person I haven't done much js. Still there should be a link in the doc to something like this and not assume users know the flags or know it's js.

  • Remove all spaces from string ("\s" matches any whitespace, "g" = global, replaces all occurences):

    ramones where did you find a list of the flags? I can't find it anywhere. The doc on this is ridiculously thin..

    do you know how to concat the flags together? if I wanted to remove whitespaces and "-" dashes? or do I have to do it as separate Actions? I actually want to remove all non alphas... is there a flag for that?

  • sqiddster right okay,that makes sense.. I was thinking it was doing it all the time because of how you call it in your capx example. It's a little overkill for what I'm working on right now.. I have little fighter ships that are doing "fly bys" and peppering the player with a little auto-laser beam (not a continuous beam). But I am implementing a "laser drill" next that I will probably need something like your capx.

    R0J0hound oh that's interesting, so you are basically defining the collision poly with imagepoints..nice! wow, that does seem a brute force method..but it could come in handy on big sprites where I need the hit coordinates..although in that same line of thinking what if I had 8 image points..I wonder how costly that would be performance wise...

  • It doesn't know where the collision occurred, it would have to be calculated in js in the same way as listed here.

    bummer..thanks for letting me know..

  • thanks sqiddster that looks like a cool capx.. thanks for sharing that. In my case (a space game) all the "solids" are interactive things, so it doesn't save me any performance. I also need to use on Collision opposed to Overlapping because I don't want it to continuously trigger. plus my laser is more like an automatic gun.. it fires long pulses (but beams) and spawns lasers on top of lasers, each laser is somewhat like a 'bullet' and lasts about 0.25 seconds.

    my much simpler solution is: OnCollision with the laser, redraw the laser to the x/y of the colliding object and have the object spawn the "hit effect" (and you have to pin it incase the object is moving fast!). It ends up putting the laser "into" the object more, instead of stopping at the edge. I have an overhead view, so it works. If I end up using this weapon against large sprites (512x512) that's probably not going to work. So I may use that raycaster logic yet!

  • If the laser at any point overlaps the object, then with a loop make the laser a little shorter until it's not overlapping the object. At that point the end of the laser is the collision point.

    ah okay..I think I see what you are saying-- have the object cut off the laser (like a hand in front of a flashlight) and grow it until they hit the object.. I will try it..

    You could also utilize the chipmunk behavior as it has some stuff built-in to get the collision point. Vanilla C2 collision detection only finds if two objects intersect, at no point is a collision point calculated so you'll have to use one of the above approaches.

    Well that's too bad because it seems like the OnCollision Trigger "knows" there was a collision and must know where it is on the screen. Too bad it doesn't return or populate a system variable like: Sprite.OnActiveCollisionX and Sprite.OnActiveCollisionY

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound the problem is.. the shooter is moving, therefore the laser is pinned to the shooter (where it grows from). And it grows really quick. The object thats being shot at is also moving. The laser after fully grown just fades out. I do a bunch of them, slightly overlapping one another.. like a sort of auto-laser.

    so the potential objects that the laser could hit, or rather objects that could collide with the laser while it's fading out could easily hit the laser somewhere in the middle as they are going by the extended laser beam. This laser never shrinks (I do have others that do).

    So there's no way to detect collision x/y?? I find that hard to believe.

jobel's avatar

jobel

Member since 27 Jul, 2013

Twitter
jobel has 8 followers

Connect with jobel

Trophy Case

  • 11-Year Club
  • 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
  • x4
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies