Stopping an actor

13

Comments

  • diegolaya_diegolaya_ Member Posts: 69

    @tatiang said:
    My guess is that you'd have the Move behavior active only when the player is not swiping but I'm not sure.

    I have no conditions, only the behavior

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    But you have conditions for swiping so you would need to incorporate the behavior into those, possibly in an Else section. Because @Socks is using vectorToAngle, he might have a better sense of how to do that. Typically, swipe distance is determined and that can be used to set up an Else condition for when swiping is NOT occurring. But I think his demo only measures swipe direction, not distance.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822

    @diegolaya_ said:
    Sorry :D , let me see if I can explain it better.. If you see right above theres a GIF from Socks, thats how my game it now.. The horizontal lines move down, like in "Dont touch the white tile" you know what I mean? So, I want my actor to move down with the lines unless I want it to move up to avoid the game over (If the actor touches the bottom of the scene you lose)... better?

    I don't understand any of that !

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks said:
    I don't understand any of that !

    Its really hard to explain as my native language is not english. ok...The scene is divided by vertical and horizontal lines, that make it look like it had lots of squares.. So, I made the horizontal lines move down so that it looks like the background as well is going up. The point is that I want those lines moving down to pull/push/drag/move the actor (square) with them so that they make you touch the bottom and lose. Better?

  • SocksSocks London, UK.Member Posts: 12,822

    @diegolaya_ said:
    The scene is divided by vertical and horizontal lines, that make it look like it had lots of squares..

    Understood.

    @diegolaya_ said:
    So, I made the horizontal lines move down so that it looks like the background as well is going up.

    Not sure about this part . . . are the horizontal lines and the 'background' the same thing, are you using two terms for the same thing here or is there another element besides the horizontal lines that is called the 'background' ?

    And if the horizontal lines are going down (and they are the 'background') then it will look like the background is going down rather than up ?

    @diegolaya_ said:
    The point is that I want those lines moving down to pull/push/drag/move the actor (square) with them so that they make you touch the bottom and lose. Better?

    What is 'you' in this context ?

    Are 'you', 'the actor' and the 'square' all the same thing ?

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks Yes, they are all the same.. And maybe this will make you understand... What happens if I create an actor called "Horizontal Lines" change its size to width 320 and height 1, position him right in the middle and set a rule that says "Move in direction 270 relative to actor" and in the scene I click on Wrap Y? That line will start going down and reappearing in the top infinite times right? Well, imagine that going on but with a line every 40y (Because the square/Actor is 40x40)

  • SocksSocks London, UK.Member Posts: 12,822

    @diegolaya_ said:
    Socks Yes, they are all the same.. And maybe this will make you understand... What happens if I create an actor called "Horizontal Lines" change its size to width 320 and height 1, position him right in the middle and set a rule that says "Move in direction 270 relative to actor" and in the scene I click on Wrap Y? That line will start going down and reappearing in the top infinite times right? Well, imagine that going on but with a line every 40y (Because the square/Actor is 40x40)

    Ok, make sense, so you want these lines to push the square ?

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks Exactly! If the square touches the bottom of the screen the game is over, so the point of the lines pushing the square down (along with obstacles) is to make the game over (in other words, to make you lose)

  • SocksSocks London, UK.Member Posts: 12,822

    @diegolaya_ said:
    Socks Exactly! If the square touches the bottom of the screen the game is over, so the point of the lines pushing the square down (along with obstacles) is to make the game over (in other words, to make you lose)

    Well seeing as none of this was mentioned in your original question - and only introduced once that question was addressed - I can't see how the method for moving the square I outlined would fit easily into the new requirements, so I guess you'd have to start from scratch.

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks Thats what I thought.. I didnt know that would mess up things... So, if I want to do this, the rules you gave me wont be useful anymore? :s

  • SocksSocks London, UK.Member Posts: 12,822

    @diegolaya_ said:
    Socks Thats what I thought.. I didnt know that would mess up things... So, if I want to do this, the rules you gave me wont be useful anymore? :s

    Hard to say without sitting down for a couple of hours and working out the best way, but more than likely you would have to take a different approach.

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks said:
    Hard to say without sitting down for a couple of hours and working out the best way, but more than likely you would have to take a different approach.

    I really appreciate your help man!.. Im thinking out how to do this, if I figure out how, Ill let you know

  • SocksSocks London, UK.Member Posts: 12,822

    @diegolaya_ said:

    Maybe make a very tall scene (like massive, 48,000 pixels high or something like that) - one you can navigate with the method for moving the square I outlined - then animate the camera moving upwards . . .

    You can detect whether the square hits the bottom of the screen with either a wide horizontal actor constrained to the bottom of the camera - or through some simple maths that measure the distance between the square and the camera.

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @diegolaya_ said:

    Example:

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks: Seems great to me! But before trying out... Can I make the bottom bar thiner? and also, as you dont recommend me using the replicate actor, what should I do instead? Or, why do you not recommend it?

  • SocksSocks London, UK.Member Posts: 12,822

    @diegolaya_ said:
    Socks: Seems great to me! But before trying out... Can I make the bottom bar thiner?

    Seriously ! Lol :) Is that a serious question !? Unfortunately no, GameSalad has only one size of 'bottom bars', and there is no way to modify the size :smiley: Also you were right to type out a question rather than to simply test this yourself, I recommend this is always the first step, never assume anything is going to work.

    @diegolaya_ said:
    and also, as you dont recommend me using the replicate actor, what should I do instead? Or, why do you not recommend it?

    I've found it to be less efficient than simply tiling an actor.

    I would make your background actor 320 pixels x 48,000 pixels (or however tall you want it to be) - and then in the Graphics attributes set 'vertical wrap' onto 'tile' so the image is tiled within the actor.

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks Cmon Socks!! Was that sarcasm?! :D

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks said:
    I would make your background actor 320 pixels x 48,000 pixels (or however tall you want it to be) - and then in the Graphics attributes set 'vertical wrap' onto 'tile' so the image is tiled within the actor.

    I didnt have a "Background actor" Im creating it now, but how do I make it have the grid? As I see on the video it is an image

  • SocksSocks London, UK.Member Posts: 12,822

    @diegolaya_ said:
    Socks Cmon Socks!! Was that sarcasm?! :D

    :p

  • SocksSocks London, UK.Member Posts: 12,822

    @diegolaya_ said:
    I didnt have a "Background actor" Im creating it now, but how do I make it have the grid? As I see on the video it is an image

    Just create a grid image (in theory a single square will do), import it, apply it to the actor and set it to tile.

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks Hey! Theres a part of the video where you cut something, its in the camera controler and detector.. It says constrain attribute self.position.y to scene.Camera.Origin.y + ???

  • SocksSocks London, UK.Member Posts: 12,822

    @diegolaya_ said:
    Socks Hey! Theres a part of the video where you cut something, its in the camera controler and detector.. It says constrain attribute self.position.y to scene.Camera.Origin.y + ???

    I think it was 22, I just moved it up a little so you could read the word 'dead', but you don't have to copy any of this, it just shows you the concept, it was thrown together in 2 minutes, no need to stick to any of it.

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks said:
    I think it was 22, I just moved it up a little so you could read the word 'dead', but you don't have to copy any of this, it just shows you the concept, it was thrown together in 2 minutes, no need to stick to any of it.

    I dont really understand what you did there so I just copied it, but I dont know... I might be doing it wrong because the bottom bar goes up and thats all that happens

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @diegolaya_ said:
    I dont really understand what you did there so I just copied it, but I dont know... I might be doing it wrong because the bottom bar goes up and thats all that happens

    Ok ?

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks said:
    Ok ?

    Hey, it doesnt work for me... I dont know why.... Perhaps, your scene.Camera.Origin.Y for me is game.Camera.Origin.Y does that affect anything? and I dont understand the way you positiones the actors in the scene

  • diegolaya_diegolaya_ Member Posts: 69
    edited January 2015

    @Socks said:
    Ok ?

    Im so stupid sorry... I was confusing something.. The only problem is that I cant see the background actor...

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @diegolaya_ said:
    The only problem is that I cant see the background actor...

    This kind of feedback is not really much use.

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks said:
    This kind of feedback is not really much use.

    Of course its useful! See? it works now... Thank you very much

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Best thread ever. @Socks spins his magic again. ;)

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • diegolaya_diegolaya_ Member Posts: 69

    @tatiang said:
    Best thread ever. Socks spins his magic again. ;)

    Hahaha you both did!

Sign In or Register to comment.