Movement issues



Firstly, sorry about the music in the video :D

Okay, I'm trying to make it so that when the character arrives at a wall (barrier), he no longer will be able to move in that direction. I tried the Collide behavior, but it shot the character about 1000 pixels in the opposite direction. Anyone have a system that would work for a game like this?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Collide behavior with bounciness set to zero on both actors. And possibly friction set to zero also.

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Actually, now that I've watched the video I wouldn't use collisions at all. I'd use tables and Interpolate the movements.

    This template was one of my first introductions to tables and it left a lasting impression:

    http://forums.gamesalad.com/discussion/38411/free-tables-template-from-dba

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

  • tylerglessnertylerglessner Member Posts: 246
    You always come to the rescue @tatiang and I really appreciate that! I took a look at the template and it'd be perfect if tables could be larger than 100x100! I tried the bounciness thing (didnt even know about that to begin with, so good to know for the future!) and when the character hit the wall, it would freeze in place and couldn't move!
  • tylerglessnertylerglessner Member Posts: 246
    edited February 2014
    I retract that statement. Wasn't aware tables could go as high as 999x999 :)

    EDIT: New question. How would I modify the template to make the character slide to position like my system in the video? I tried the move to behavior and the game had a minor (or major) freak out.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    How would I modify the template to make the character slide to position like my system in the video? I tried the move to behavior and the game had a minor (or major) freak out.
    That's why I suggested Interpolate. Although, if you need to have that actor collide with other (e.g. enemy) actors that may not work for you.

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

  • tylerglessnertylerglessner Member Posts: 246
    @tatiang I'm trying to make it so that I can make the table bigger, but the screen always adjusts to the center of the table instead of moving to the bottom left. Any way to change that?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    the screen always adjusts to the center of the table instead of moving to the bottom left.
    I'm not sure what you mean by that. If you are spawning actors based on table data, then the algorithm for spawning will determine where they appear on the screen. Post a screenshot of the rules or at least post the position (x & y) of the spawn behavior and whether it's relative to actor or scene as that is the key here.

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

  • tylerglessnertylerglessner Member Posts: 246
    This is kind of difficult to explain, so bear with me! As the template sits, it fills up the entire scene with possible positions you can move to. What I'm trying to do is expand the table so I can increase the scene size, but when I do, the old coordinates do not move to accommodate the change, they remain in place. So that means the new rows and columns are going into negative coordinates and I cant work with them if I cant see them. How do I shift the "grid" up and to the right?
  • tylerglessnertylerglessner Member Posts: 246
    @tatiang I guess I just need it to move up, not to the right
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Tyler @tylerglessner are you using DBA's table collision demo that I posted a link to? I may have to go look at that to help you as I forget exactly how it's set up.

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

  • tylerglessnertylerglessner Member Posts: 246
    @tatiang yes I am! When you add columns, it's fine, but when you add more rows, that's when it goes negative
  • tylerglessnertylerglessner Member Posts: 246
    @tatiang sorry for the double post, but I'm using the first scene where it moves at 16 pixel intervals
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    That demo is great but it was (I believe) designed more as a proof of concept than an actual template to work from. Because of that, the size of the table was more or less hardwired into the code.

    image

    The 20 at the start of the expression is subtracting from the total number of rows which happens to be 20 in the demo. If you had 45 rows, you'd need to subtract from 45. So try replacing the 20 with tableRowCount(tableName).

    That value of 20 may be hardwired somewhere else in the project file but I didn't see it after a quick look.

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

  • tylerglessnertylerglessner Member Posts: 246
    It works! Thank you very much and awesome template!
Sign In or Register to comment.