R0J0hound's Forum Posts

  • Simpler than that there is bullet behavior property "set angle", that will do what you want if it's set to no.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's the basics of how to do it. It can be further refined to be more precise and you can use a family instead of wall to hit more object types.

    Add a Sprite to your project and call it Ray. In the image editor put it's origin on the left-center and add another image point to the right center. Once on the layout, make it's height 1.

    Every tick

    --- ray: set position to player

    --- ray: set angle towards (mouse.x, mouse.y)

    Repeat 100 times

    --- ray: set width to 100*(loopindex+1)

    [sub event] ray: overlaps wall

    --- stop loop

    --- ray: spawn explosion at imagepoint 1

    --- wall: destroy

  • Zebbi

    I suppose that would be helpful. I have an example earlier in this topic that did that somewhat. I don't have an exact example using this effect though. Currently I don't use effects at all, and I haven't used rex's behavior. In a nutshell it's because webgl is slower on my machine if used and I need to modify C2's runtime to actually be able to use it, so I don't.

    I have had a go at non effect version, a week or so ago, which may or may not be useful. It uses the paster object instead, but it does follow the pattern where the game map is defined on the "map" layer. That is where everything is moved around and everything from there is mapped to a 3d perspective.

    The events have three parts to it. The "position objects" section, which would be similar to what rex's behavior does, except it also calculates the relative angle of other objects so the correct frame is used. The "ground render" section is what the mode7 effect does (however there's a math error in there I haven't tracked down yet). Finally the "control" section controls the movement in a custom way that I liked.

    https://dl.dropboxusercontent.com/u/542 ... ce3d2.capx

    Rabbit trail aside, that was after a week of tinkering and I'm at the point where I need to rework the math to correct the ground texturing alignment. Even with the effect and the behavior there would be work to match things up imo. Even though this is thought of as pseudo 3d, in reality it requires full on 3d math with perspective transformations.

    A very useful reference is here:

    http://www.coranac.com/tonc/text/mode7.htm

  • Zebbi

    If the objects are in a container, the other would be created automatically. And yes you could just use variables instead of a second object if you wanted.

    Basically you can set it up any way you want. The ideas I have should work, or the ideas you're presenting would also work. In the end you only need one object type that is positioned on the mode7 plane. Anything else is purely for convenience or just to make other things easier to do.

    Having two objects in a container for instance makes collision detection actually possible. Consider if you had only objects on the mode7 plane, how would you do collision detection? You could try using the overlapping conditions, but really you'd get bad results. By having another object in a top view perspective, you can do collision detection with them in an easy way, plus all the movement behaviors can be used there.

  • Just to clarify a few things:

    The distance an object moves per frame is speed*dt, so with a speed of 5000 the object will move 5000/60 or about 83 pixels per frame, which is why it can pass other objects without colliding.

    For doing an instant hit, the common approach is called "ray casting", but you can also find examples on the forum about lasers that do it too. By using a sprite and changing the width you can do the same thing as the line segment idea.

    That error is a bug I'd say, and a good candidate for an error report.

    Your last issue is probably something simple, but we'd need to see a capx to find it. The posted events don't seem to cause it.

  • It is possible, I didn't say it wasn't.

    Put two objects in a container, Sprite and SpriteMode7. Position the Sprite objects in the layout editor to define the object positions. Then in the event sheet use the behavior or whatnot to set the SpriteMode7 object's position from the Sprite's position. You then move around the Sprite objects and the SpriteMode7 object will update accordingly.

  • Cool

  • It's the same with particles and tilemaps too as I recall. It could be nice to be able to disable the visibility culling, but it's done per plugin and probably will run into performance issues with some users.

    The workaround is to move the object onscreen before pasting it, which I suppose could also be done by the paster plugin...

  • it's not that it's not stable, it's just that 1/10 is the highest c2 lets dt get. So basically the game goes into slow mo if the dos drops below 10.

  • It should work as you expect if "on button" and "on button released" refer to the same button. I can't tell without seeing the actual events though.

  • Zebbi

    It's just how you look at it. To me those variables define the top view position and the actual position is irrelevant since the behavior will set that.

  • Maybe make the paster be at an integer position like int(scrollx).int(scrolly)

  • Search the forum for gesture recognition. There are a few examples and even a plugin.

  • You probably should be able to use the xml plugin to do this. Take a look at it, it has methods to loop over tags and such.

  • every tick

    --- set x to self.x+speed*cos(angleOfMotion)*dt

    --- set y to self.y+speed*sin(angleOfMotion)*dt