jobel's Forum Posts

  • 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

  • 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.

  • someone must have asked this question but I can't find it..

    I have a sprite shooting a laser.. when the laser hits another sprite I spawn a "hit sprite" which fades out.. looks like a hit effect. I make the end of the laser bolt be imagepoint(1).. so On Collision I set the new hit effect to be at that image point.. the only problem is when something collides with the middle of the laser, it spawns the hit effect no where near where it actually hit! I would have the sprite that gets hit just spawn the hit effect.. but it's pretty large so the same problem will occur.

    I just need to know the coordinates of the collision.. it seems totally possible right?? Or do I have to do some sort of Pick overlap point??

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should use SpriteFonts wherever possible.. It's not a matter of fixing it, Text is just a different beast..

    It's a lot of work, but it needs to be done... you are better off in the long run.

  • I've confirmed this happening with the GamepadControl.capx example.. so I know it's not just my game. Now to find out if it's just my computer!

    My controllers work fine if I run the preview in NW or Firefox. So it's something with the latest version of Chrome I think.