R0J0hound's Forum Posts

  • The camera object should have an expression to get the image URL. You can then use that with the load animation frame action of sprites. After that just position that sprite over the canvas and use the canvas' paste action and you should be good to go.

  • You could do it by just comparing the distance from the enemy to the player. Accelerate if the distance is greater than a radius and brake if less.

    If you'd be happy with orbiting in a circle you could use the "move at angle" action on the enemy when they're closer than the radius and use enemy.angle-90 for the angle and say 100*dt for the distance.

  • I thought saying Game Over was the end.

  • [quote:3dddxys4]* Move the horizontal and vertical lines in a controlled and defined manner.

    Well you have a start point (where you started touching) and a end point (where you're currently touching). You could calculate the angle from start to end and use some choose a direction if the angle is close to 0, 90,180 or 270. There are conditions that help with this.

    [quote:3dddxys4]* Create this line, as the player moves on the field.

    Every time you move create a circle at the player. For the line between the dots you can make a rectangle sprite with it's hotspot left-center. It's height should be the diameter of the circle and it's width should be the distance between one move to another. So you create this sprite at the player and set it's angle toward the previous circle. You have the direction moved so you can add 180 to that to get the angle.

    [quote:3dddxys4]* Recognize what is going right and left.

    Beyond visualization, which the previous question had a solution for, you can store the inAngle and outAngle in instance variables of the circles. Just set them in the moving stage.

    And my experiment of the day trying out some different ideas.

    https://www.dropbox.com/s/yi7fthhebl9nt ... .capx?dl=1

    /examples24/flowfree.capx

    Not really helpful, but it has an amusing flaw.

  • It's the same reason all the pieces are all red. The "Pick all" condition doesn't pick objects that were created on that frame. This was a change that occurred a long time ago. Events 22-24 need reworking to fix it.

    Change it from this:

    To this:

  • No idea from your description. A simple capx could help.

  • Anything lower than "every 0.016 seconds" is the same as "every tick". You could instead add dt to the variable every tick and after 1 second the value will be very close to 1.

  • I speculate that the reason the website is so slow is because the servers are becoming sentient, and are devoting more and more possessing power toward planning world *********** I just hope the Gullen bro's have amassed enough flying monkey's to hold the servers at bay once they achieve locomotion, and unleash their retribution.

  • 1

    Create new project

    2

    Add mouse, text, and canvas objects

    3

    Give the canvas object an image and position it at 0,0

    4

    Go to the event editor and add a "every tick" condition.

    5

    Add the action: text-> set text to canvas.rgbaAt(int(mouse.x), int(mouse.y))

    6

    Run it and the text object will tell the color under the mouse on the canvas object.

    Extra tidbits:

    Int() is used since mouse.x can give values like 10.5 when window scaling is used and the value needs to be a whole number.

    .rgbaAt uses x and y values relative to the top left of the canvas object. So if you moved the canvas object from 0,0 you'd have to change the expression to:

    Canvas.rgbaAt(int(mouse.x-canvas.x), int(mouse.y-canvas.y))

    Finally notice it only gets the color from the canvas' own texture. Use the drawing actions to change this texture.

  • You can use c++ to make plugins. You can download the sdk from here:

    http://sourceforge.net/p/construct/code/HEAD/tree/

    Youll need to use visual studio since the sdk uses CString. Their was a wiki with a guide, but it seems to have disappeared. You can look at the source for other plugins as examples, also you can find a lot of info here:

    construct-engineering_f168

    You could use c++ from python but it would require a python lib that allows you to use c++, or you could compile a dll and access it from python with ctypes. You'd have to use python to interface with anything in the engine though.

    I have done some expiriments with accessing sprites from c in a dll, but its tricky and still needs python to call the dll.

  • Another idea is you can use the "wait" action with actions to change angle and turning speed in between.

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

  • I can attest to arrays making it easier. Especially if you want a way to see if the kings are in check. I also recommend using the function object too. It can help you eliminate redundant events and keep you below the 100 event limit for the free version.

    Do you think you'll support more exotic moves like "en passe" and "castling"?

  • ErekT

    You can calculate it though. The complexity depends on what shapes you use. Of course an overlap seldom occurs at one spot unless they are just touching.

    The simplest would be a circle circle collision. The collision normal would be the angle from circleA to circleB.

    Normal_AtoB = angle(circleA.x,circleA.y,circleB.x,circleB.y)

    Then the point on CircleA would be (CircleA.x+radiusA*cos(Normal_AtoB), CircleA.y+radiusA*sin(Normal_AtoB))

    And the point on circleB would be (CircleB.x+radiusB*cos(Normal_AtoB+180), CircleB.y+radiusB*sin(Normal_AtoB+180))

  • For the physics behavior you can do a custom gravity angle by applying a force at an angle to the balloon every tick. This is by far the simplest to do.

    The motion bit isn't hard you could even do it without behaviors with two variables VelocityX and velocityY and an event like:

    Every tick:
    ---add acceleration*dt*cos(degrees-90) to velocityX
    ---add acceleration*dt*sin(degrees-90) to velocityY
    --- ball set position to (self.x+velocityX*dt, self.y+velocityY*dt)[/code:34atxzhw]
    
    The collision response with wall sliding is trickier.  I'd recommend the custom movement behavior with the "push out nearest" action but I doesn't look right imo.  But pushing out the closest direction is what is required for sliding, well that and making the speed in direction of the wall zero.  For that you'd need two pieces of info: collision normal and overlap depth.  
    
    They possibly could be found with a bunch of is overlapping at offsets to find where around the ball is free and from that get the normal, then a few more overlap checks to get the overlap depth or just to push the ball out of the solid at an angle.  With 3000 collision counts per second that would be 50 per frame at 60fps.  You possibly could get it to work with using overlap checks in events but it would be tricky.  If all your walls are only rectangles you'd only need to check 4 directions (wall.angle, wall.angle+90, wall.angle+180 and wall.angle-90).
    
    Here is a capx of that idea:
    [url=https://dl.dropboxusercontent.com/u/5426011/examples24/balloonPush.capx]https://dl.dropboxusercontent.com/u/542 ... nPush.capx[/url]
    Notice it's a bit jittery so it may need some more finesse. Maybe a sub event of 10 to backup into the wall by smaller steps than a pixel.  As it stands I get about 10 collision checks per tick.  Also pushing out at the corners of walls will be jumpy.
    
    A superior method is in slide3.capx in this post:
    [url=https://www.scirra.com/forum/viewtopic.php?f=147&t=103339&p=775018&hilit=wall+sliding#p775018]viewtopic.php?f=147&t=103339&p=775018&hilit=wall+sliding#p775018[/url]
    It does one overlap check per wall and then calculates the closest direction and how far exactly to push out.  The con is its much more complicated to make.  Also a bench would have to be done to see if it is actually fast or if the extra calculations counteract. 
    
    But again the physics behavior is the easiest to work with.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No, even internally c2 only checks if there is an overlap not where they collide.