Question on how to make an actor jump properly?

kajutokajuto Member Posts: 314
edited March 2012 in Miscellaneous
Hi!!! thanks in advance and i made this actor and 2do actor that i can jump over this one, but after that i can't jump again, it like stick to the actor with the code below. How can i make the 2do actor to jump again?

constrain X position to AAA*cos(self.time*BBB)+CCC

How it works:

AAA = the amount of movement.
BBB = the speed of the movement.
CCC = the centre (orgin) of the left to right movement.
«1

Comments

  • kajutokajuto Member Posts: 314
    edited March 2012
    Hello there!!! how you doing? i need a little help please

    i recently made a actor that move from x value to another x value (left to right & viceversa) the code i used is this:

    Timer:
    every 1.5 seconds run to completion
    Rule:
    Att : selfpositionX = 531.264
    -Change Att 
      -selfright&left to false
    Rule:
    Att: selfright&left is true
    - Interpolate
      - selfpositionX to 531.264
    -duration 1 functon: linear
    Rule:
    Att: selfpositionX=808.502
    -Change Att
    -selfright&left to true
    Rule:
    Att: selfright&left is false
    - Interpolate
      -selfpositionX to 808.502
    -duration 1 second function: linear

    I just want to move from one side or the other and up and down for another platform, because i plan to use 2 type of platform, one up and down viceversa; and another left to right viceversa. Also when i jump on top of it , i can jump again , because when i jump over, it stick to it.. =-( help please and i appreciate 
  • CloudsClouds Member Posts: 1,599
    Try this for a more simple left to right move:

    constrain X position to AAA*cos(self.time*BBB)+CCC

    How it works:

    AAA = the amount of movement.
    BBB = the speed of the movement.
    CCC = the centre (orgin) of the left to right movement.
  • kajutokajuto Member Posts: 314
    Tyran, if i do what you told me, the second actor can jump on top of it? i don't' mean collide, i mean when the 2nd actor on top of the 1st one it can jump over the same actor , like mario jump on top of the platform and can jump again in it
  • CloudsClouds Member Posts: 1,599
    if i do what you told me, the second actor can jump on top of it?
    I have no clue.
  • kajutokajuto Member Posts: 314
    U don't understand my explanation or u don't know how to do it? Just in case, when the actor jump over the other and move together from one side to another I can jump again whenever I want to just to evade a obstacle or something
  • CloudsClouds Member Posts: 1,599
    You need to help people to understand your problem.

    Take some screen shots of the code + make a video of the problem.
  • kajutokajuto Member Posts: 314
    1) I have a hero actor that i can move left and right and also a jump button.
    2) i have a platform that move left and right using this code:

    Contraint Att
    - Self.position.X to 100*(self.Time*20)+450

    the prob is this: when the #1 actor(hero) jump over the #2 actor i tried to follow it movement, which it find. the problem is here, once i'm over the #2 actor i can't jump again to another platform
  • TaidakenTaidaken Member Posts: 271
    maybe you only have it setup to jump when its only touching the ground and not the platform that moves..?
  • CloudsClouds Member Posts: 1,599
    edited March 2012
    1) . . . using this code:
    Contraint Att
    - Self.position.X to 100*(self.Time*20)+450
    Great code ! ;) (I even remember writing it for you !)
    the prob is this: when the #1 actor(hero) jump over the #2 actor i tried to follow it movement, which it find. the problem is here, once i'm over the #2 actor i can't jump again to another platform
    Someone might be able to help you, there some very intuitive people around here, but as we can't see the code or a video of the issue it could be just about anything ! People will have to ask you lots of questions about how you have things set up and working before being able to offer any advice - lots of people can't be bothered to do that.

    : (
  • kajutokajuto Member Posts: 314
    Taidaken, thanks, i forgot to tag the other platform, that's why i can't jump over in the moving platform. Tyran , sorry to bother you so much.

    I have a Score display , that i want to reset to 0

    the coin that collect i use this code:
    Rule (overlap or collide with hero)
    -change att
    -game.colletacableitem to game.collectableitem+10
    - destroy

    each time, i collected the coin, it's counted me +10, how can i reset each time i play the first level or even i restart the scene
  • CloudsClouds Member Posts: 1,599
    Tyran , sorry to bother you so much.
    No problem at all !
    how can i reset each time i play the first level or even i restart the scene
    On the rule that restarts the scene or takes you to the first level . . . . place this:

    Change Attribute: game.colletacableitem to 0

  • jomediajomedia Member Posts: 18
    i think you can change the score value when you touch the reset button change attribute and make the score value to 0

    again :)
  • kajutokajuto Member Posts: 314
    thanks Tynan and Jomedia!!! Tynan, if i pay you every time i ask you to help me or do something from scratch, would like to accept it? i pay through paypal

    there is a maybe a stupid question, but till now i don't know how i calculate the scene x or y distance for example, the platform below:

    kajuto said:
    1) . . . using this code:
    Contraint Att
    - Self.position.X to 100*(self.Time*20)+450

    i don't know, how i should know the x value or y value, for the 450 for example, because sometime i want to move from let say x=200 to 800 it move from another x value instead of where i want it to be
  • CloudsClouds Member Posts: 1,599
    thanks Tynan and Jomedia!!! Tynan, if i pay you every time i ask you to help me or do something from scratch, would like to accept it? i pay through paypal
    $50,000 / hour.
    there is a maybe a stupid question, but till now i don't know how i calculate the scene x or y distance for example, the platform below:
    Let me make you an illustration . . . . I will be back (have my $50,000 ready ;) )

  • kajutokajuto Member Posts: 314
    Thanks in advance to do me a big favor!!! really , would you like the offer? because each time i ask something , sometime nobody answer me or even take a lot of time to answer my doubt
  • CloudsClouds Member Posts: 1,599
    edited March 2012
    would you like the offer? : No money for me ! It's all free !


    Does this make sense ? . . .

    image
  • CloudsClouds Member Posts: 1,599
    edited March 2012


    So . . . AAA*cos(self.time*BBB)+CCC

     

    AAA = the amount of movement.

    BBB = the speed of the movement.

    CCC = the centre (orgin) of the left to right movement.




    "for example, because sometime i want to move from let say x=200 to 800 it move from another x value instead of where i want it to be"


    200 to 800 = 600 pixels of movement (AAA)


    The centre of 600 pixels is 300 pixels.






    So to get 200 to 800 . . . . . 


    300*cos(self.time*BBB)+500


    . . . . . . . . . . . . . . . . . . . . . . 


    Why 300 ?


    You want 600 pixels of movement - 300 left and then 300 right.



    Why 500 ?


    When you move 300 pixels left (from x=500) the actor will go to x=200.

    When you move 300 pixels right (from x=500) the actor will go to x=800.

  • kajutokajuto Member Posts: 314
    Wow, now I get it . Thanks a lot I'm very appreciate your help .!!

    1) Do know any site that explain all the expression that GameSalad use like cos, sin , random, ect ect ??

    2) How I calculate the distance or pixel where i put an actor to another segment in the scene editor ? For example Autodesk Maya or other program have a Guide Rule so I know where I'm putting a actor and know the distance, ect...
  • CloudsClouds Member Posts: 1,599
    1) Do know any site that explain all the expression that GameSalad use like cos, sin , random, ect ect ??
    http://web.archive.org/web/20101201124532/http://gamesalad.com/wiki/interface_reference:expression_editor

    + Wikipedia.
    2) How I calculate the distance or pixel where i put an actor to another segment in the scene editor ?
    image
  • CloudsClouds Member Posts: 1,599
    edited March 2012
    @FryingBaconStudios
    @tynan nice post!

    Cheers Frying :@) Studios !
  • kajutokajuto Member Posts: 314
    Tyran i like a lot the explanation about the pixel, but inside the Scene Editor how or there is a way that i can activate a rule or something? because when I'm doing the moving platform i have to guess where 200 pixel it might be for example
  • CloudsClouds Member Posts: 1,599
    edited March 2012
    Tyran i like a lot the explanation about the pixel, but inside the Scene Editor how or there is a way that i can activate a rule or something? because when I'm doing the moving platform i have to guess where 200 pixel it might be for example
    There is no rule, no grid, no guides . . . nothing. In this respect GameSalad is worse than a typical text editing utility from 1996.

    To place an actor precisely at X=200 . . . . . double click the actor in the scene and change it's X position value to 200 in the attributes panel on the left hand side of the screen.
  • kajutokajuto Member Posts: 314
    Jajajaj wow I can't believe I have to use a actor as a rule or grid for that jajaja thanks I imagined it might be that way but I just want to someone to confirm me.

    Tyran. U know the code that u help me AAA*(selftime*BBB)+CCC ,Supposely I use that okay... I don't the platform to move until the hero actor is close enough to the platform then he can move. Is like the tutorial made by tshirtbooth using magnitude..
  • CloudsClouds Member Posts: 1,599
    U know the code that u help me AAA*(selftime*BBB)+CCC ,Supposely I use that okay... I don't the platform to move until the hero actor is close enough to the platform then he can move. Is like the tutorial made by tshirtbooth using magnitude..
    Is this a question ?
  • kajutokajuto Member Posts: 314
    yes, sorry LOL forgot the ??

    i want when the hero actor is very close to the platform, then the platform start to move down so the hero can walk on top of it...
  • kajutokajuto Member Posts: 314
    Tyran the code that you gave me , that it work with Y axis? because i need one for up & down...please
  • CloudsClouds Member Posts: 1,599
    Tyran the code that you gave me , that it work with Y axis? because i need one for up & down...please
    Are you joking ? :))

    Before I answer that, can you answer me this question, I want to know if I can use capital letters on this forum, not just one at the start of the word (like: This) but I want the whole word to be in capitals, do you think this is possible, have you tried anything like this ?
  • CloudsClouds Member Posts: 1,599
    edited March 2012
    yes, sorry LOL forgot the ??

    i want when the hero actor is very close to the platform, then the platform start to move down so the hero can walk on top of it...
    I think the magnitude tutorial by tshirtbooth that you mentioned should help you work that one out - you might even be able to do it without magnitude just using the actors 'X' position.

    ?
Sign In or Register to comment.