Newbie just getting feet wet

swamp-softswamp-soft Member Posts: 3
edited November -1 in Working with GS (Mac)
Completely new with Gamesalad and trying to get the hang of it, also haven't programmed in many years! This seems like it should be easy, but after searching I still haven't found a good answer. How do you keep your actor on screen? In a basic back and forth movement, such as a paddle or say an old school shooter (a la space invaders) how do you keep the actor from leaving the screen? I would think with constraints but so far I haven't been able to get it to work? Thanks for the help.

Comments

  • jweaver911jweaver911 Member Posts: 439
    yeah. you can use constraints with the greater than or equals to OR less than or equals to operators in conjunction with a specific pixel value onscreen. That's how I have done it. You can tell it to move as long as its x or y position is < or = to a specific value. And you can constrain it then to the opposite axis if it is a paddle or shooter of the sort. Hope that makes sense.
  • jstrahanjstrahan Member Posts: 498
    Welcome to GS community
    Look into using min and max in the expression editor
    Also get phonics book it will be a good reference as u work in GS
    Yes that was a plug for photic
  • GRIDGRID Member Posts: 30
    I put inmoveable, collidable walls just outside of the viewing screen. Works a treat for me so far ... but I've only been using GS for 3 days now :)
  • scorelessmusicscorelessmusic Member Posts: 565
    What GRID said... that's how I did some of my experiments too. There are usually multiple ways to creatively solve a programming problem. Some are more optimized than others and it's almost like a game itself, this debugging and finding better ways to achieve the same goal. ^_^
  • jstrahanjstrahan Member Posts: 498
    Yea invisible blocks work and fine for small games but doing it programiclly is the better way
  • jweaver911jweaver911 Member Posts: 439
    jstrahan said:
    Welcome to GS community
    Look into using min and max in the expression editor
    Also get phonics book it will be a good reference as u work in GS
    Yes that was a plug for photic

    Is that more efficient then having a stopping point like I explained? Just curious, or is that just personal preference? I'm always open to learning more efficient ways to do things.
  • jstrahanjstrahan Member Posts: 498
    Not sure maybe cause u can do it with one rule instead of one to check for <= and one for >=
  • jweaver911jweaver911 Member Posts: 439
    jstrahan said:
    Not sure maybe cause u can do it with one rule instead of one to check for <= and one for >=

    Sure that makes sense.. One is better than two ;) I'll try that next time I need such action.
  • jstrahanjstrahan Member Posts: 498
    @swamp
    Does ur name mean u live in the swamps
  • swamp-softswamp-soft Member Posts: 3
    Thanks guys for the suggestions. I haven't been back in a few days, been a busy week.

    @jstrahan...yes I live in a swamp
  • swamp-softswamp-soft Member Posts: 3
    I added an attribute to each directional movement rule telling it to move as long as the x value was greater than or equal to, or less than or equal to specific values. I did not have to add a constraint. Thanks everyone.
  • jstrahanjstrahan Member Posts: 498
    Welcome
    I live in Louisiana not far from the worlds biggest swamp
Sign In or Register to comment.