mahdi71's Recent Forum Activity

  • Set Point X Sprite.X+cos(Sprite.Angle+Point.myAngle)*Point.myDistance

    Set Point Y Sprite.Y+sin(Sprite.Angle+Point.myAngle)*Point.myDistance

    Or if I understood this correctly

    [quote:2f8o8abu](always get the top point of an object (object angle doesn't matter) )

    like variable myangle = 90 then i get the position of point from right side of object

    Set Point X Sprite.X+cos(270+Point.myAngle)*Point.myDistance

    Set Point Y Sprite.Y+sin(270+Point.myAngle)*Point.myDistance

    Note that angle 0 is to the right.

    yes... its good and working ...

    thank you very much ...

  • hi,

    how do i get the point position on this picture ?

    [attachment=1:2lmcurt4][/attachment:2lmcurt4]

    [attachment=0:2lmcurt4][/attachment:2lmcurt4]

    what is the formula ?

    as you can see i want the left side point (x and y) position from the object..

    i want to create that point ..

    the distance of that point from the object is a variable like "mydistance"

    and i want to set another variable like "myangle" and get the other point from object too .. like top point of object (always get the top point of an object (object angle doesn't matter) )

    like variable myangle = 90 then i get the position of point from right side of object

    thanks

  • hi

    some group:

    mouse left botton is down :

    • object1 set position to mouse x,y

    ..

    so many groups and events and actions

    ..

    another group:

    foreach object2:

    • set position to object 1
    • set angle to object 2

    __________

    but object2 is late ... when i move the mouse a little faster ... or when object1 rotate a little fast

    but when i set position and angle of object2 just after the object1 in the same event (mouse left button is down) then it is ok and have no late !

    if i set that in the same event i will be confused later ... so is there another way ? (in unity we have lateupdate function for that ... so that function make sure in the last of every frame things happen)

  • how can i do like this :

    [attachment=0:wuqx8o14][/attachment:wuqx8o14]

    i mean the blue edge fog

    ...

    thanks

  • Vx and vy are the x and y velocities of the target.

    Instead of atan2(y,x) you can use angle(0,0,x,y)

    how do i calculate Vx and vy ?

    i still looking for formula ...

  • I edited my post above with an formula that is language independent, I just googled the formula for you

    thanks .. but i know that .. i whant the formula in construct 2 ...

    if anyone can change the formula to construct 2 please do it .. ?

  • Hope this helps:

    function aimAngle(target, bulletSpeed) {
        var rCrossV = target.x * target.vy - target.y * target.vx;
        var magR = Math.sqrt(target.x*target.x + target.y*target.y);
        var angleAdjust = Math.asin(rCrossV / (bulletSpeed * magR));
    
        return angleAdjust + Math.atan2(target.y, target.x);
    }[/code:1lcl92kw]
    

    thanks ..

    but what is "target.vy and target.vx" ?

    and construct 2 dont have atan2 ... (i think i must use "angle" but how ?!)

  • hi

    i can not use turret behavior so i made my own turret system ...

    but i need for Predictive aim system

    what is the formula ?

    i have variables like :

    • projectile speed
    • turret and target position and angle

    and i know my target moving or not

    ...

    thanks

  • 1. Please give an example of how picking only an instance of an object type would help. Also see the provided example capx.

    2. Construct2 has a .

    3. It's not up to Construct to do it, but actually to you to delay those type of operations so the request to regenerate the obstacle map is not happening every tick.

    4. Use the action "Request full screen".

    Hi.

    Thanks for tip 4 now I can use full screen and I am so happy.. its good...

    1. I have 2 player and each player can create tank and I must use diffrent instance variable like group and for player 1 set group to 1 and for player 2 set that to 2.. then I must pick tanks with instance variable group 1 and set target to other group... if we use tank as target of tank ..then tanks shoothing themself.

    I had to make my own targeting system for that...

    If its still unclear i can upload a capx example...

    ...

    And I just say dynamic pathfinding is missing in construct 2 ...

  • hi,

    i working with construct 2 and this things i think must be added in next updates ...

    1.Turret behavior :

    we can not pick some of an object (or family) as a target .. like objects with different instance variable (like different group) as a target.. (turret behavior just add all family or object as a target ....)

    .........

    2.debug system :

    construct 2 is fast .. so faster then programming but if you have a bug it can get so much of your time because you must use somethings like texts or... to see what happens .. if when we start the game in preview we could see wich event and action runs (like when an action or event run they color change to green and events and actions which not running they get normal color..)

    .......

    3. dynamic pathfinding : pathfinding behavior is so good ... but ..

    almost all good game engines have dynamic pathfinding .. and i know its so difficult .. but it can happen .. i mean pathfinding system must get more updates...

    Suggestion : instead of generate obstacle map for each object, use just one obstacle map and generate that map in so many frame (dont generate obstacle map in one frame .. generate just some of that in each frame ... then we have obstacle map in like every 2-4 seconds .. because every piece of that maked in one frame ...then use the same thing for calculate patch for each object .. so we have no lag ... and objects no more overlap eachother

    and we can have heavy algorithms like dynamic pathfinding…

    construct 2 just do every thing in 1 frame and this make this good engine a little solid … you just can do heavy thins in more then one frame…)

    ..

    .......

    4. export to full screen windows game: ... (node-webkit is good but we can not have a really full screen mode (its just have maximum window size))

    ......

    thanks for this good game engine

  • mahdi71

    You could also use anglediff(angle1,angle2) when doing the comparison, which should be ok with negative angles.

    Here's an example

    [attachment=0:221ey5kj][/attachment:221ey5kj]

    Just drag the blue target around and the turret will follow it.

    Yes .. its better .. thanks ...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ok ...

    you guys right

    but angle(Turret.X, Turret.Y, Target.X, Target.Y) give me a number less then 0 sometimes like -110 so i add the number to 360 if that number is less then 0 then this solve my problem ... thanks ...

mahdi71's avatar

mahdi71

Member since 24 Aug, 2014

None one is following mahdi71 yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies