Player Control (and disable) and collision with (wall)actor problems

MrshoestoreMrshoestore Member Posts: 181
edited November -1 in Working with GS (Mac)
Hello Everyone!

I'm new to this whole rambajamba they call game developing. I was attempting to figure things out myself, and it was going well, until I created a jumbled mess of rules and attributes and behaviors that end out not doing what I wanted. So… I now look for help:

Here is how I want the Player(ball) to work.

Rule - Move Left(Right)

When All (key LEFT(RIGHT) is down) and (attribute game.Dash is false)
Accelerate direction 180 at 100 up to max speed of 500

Rule - Jump

When All (key SPACE is down) and (attribute self.Ground? is true)
Change Attribute self.Motion.Linear Y to 400

Group - Dash

Rule - Set Dash

When All (key D is down) and self.Motion.Linear X is max speed

Change Attribute game.Dash to true
Change max speed to 1500
Change Attribute self.Motion.Linear Y to 1000

Also when game.Dash is true, I want to disable the players ability to control the ball, until the speed slows down to a certain level. (that's sort of a…sample code. now that I look at it, I'm thinking a lot has changed and I don't even know the state of how that works.)

What I'm trying to do is this. The player controls a ball, and can move left/right and jump like a normal platformer (with custom gravity affecting player). But when the player is at max speed and presses the Dash button (D) the max speed increases super fast, the ball jumps up and player loses control(left/right/jump has no effect). Now, when the ball collides with walls (left and right and ceiling) it incrementally decreases the velocity of the ball while continually bouncing the ball upwards at a slightly random upward angle until it's below the original max speed . So the goal is to try to Dash your ball to a higher ground level. But too many bounces and your ball slows down too much and succumbs to gravity and you try again.

So I've messed with various of the above trying to get it to work and I kept running into a million problems, like the ball sinking through the ground actor, bouncing at the wrong angle when hitting a side wall, hitting the ceiling getting stuck. Not Dashing… Not Not-Dashing…

….I have a headache…

So if anybody has a clue to what I'm trying to do, and have suggestions as to solutions or ideas or start points or whatnot, I thank you so so much. Any thoughts will do. I'm assuming the controls and physics that I want are completely possible, and it's my lack of a clue that's the problem.

If no one can help that's fine as well. My plan as of now is to go to sleep and start from scratch in the morning. Hopefully someone will have a nice message for me when I return to the keys!

Thanks!

Comments

  • hotMagichotMagic Member, PRO Posts: 266
    It will be easier to help you if you post the specific issues and the situations that cause them. For example, the ball sinking through the ground. When does that happen? When does it bounce at the wrong angle? etc.
  • MrshoestoreMrshoestore Member Posts: 181
    Ok, so I got some sleep and started from scratch and fixed almost everything. But when the ball collides with the walls, I can't get it to act right. If I use the collide behavior, the ball just bounces back and forth along the x-axis, until the ball slows down.

    What I want is so that when the velocity of the ball is greater than 500 (which is set by a dash function, the ball changes velocity x to 1500 and jumps at velocity y of 1000), it bounces between the two upwards. when it's at 500 or below (which is regular jump, velocity x at 500, velocity y at 300), it falls down with gravity (a constant down velocity of 400).

    did I explain that well enough?
  • MrshoestoreMrshoestore Member Posts: 181
    Nevermind, I got it.

    I'll throw this one out there in case someone else can figure it out before I can.

    I have a rule set on some of my walls that when it collides with Player actor, it changes a bell.Random attribute to random(1,11) to generate a random musical note

    Then there is another controller actor that defines what each one is (what attribute number plays what sound)

    Everything works great when the player collides normally, unless the Player is in "Dash Mode"

    "Dash Mode" functions so that when game.Dash = false, player can have control over actor character.
    when game.Dash= true, player does not have control of the Actor.

    So Dash Mode does not change the actor, just the ability to control (and the speed momentarily), so why then, when my Wall Actors has a Collision with the Player Actor in "Dash Mode" will it not play a sound??
  • MrshoestoreMrshoestore Member Posts: 181
    Bump this back up.

    I'm still having difficulty finding a solution for the last problem.

    Anyone know why my wall actor's collision function does not act properly with my player actor during certain player actor functions, despite the fact that the player actor is still the same, well... actor?
  • hotMagichotMagic Member, PRO Posts: 266
    So just to eliminate the obvious stuff...it appears that the thing is colliding. BUT, is the collision message being received? Have you been able to get it to display text or kill itself or some other simple thing when it gets the collision event?

    Did you also try the inverse? In which the player does the sound, rather than the wall?
  • MrshoestoreMrshoestore Member Posts: 181
    So I gave the player all the behavior controls, and it still didn't work. I decided to start building up other levels/scenes, and it worked just fine in those scenes. so I went back to the first, deleted just one of the instances of a wall actor and tested to see if it worked on that one wall, and it worked on all the walls! Sooo... I don't know... must have been a glitch in the Matrix, but thanks for the help/suggestion!
Sign In or Register to comment.