Need help with soccer/hockey style game.
![arkonllf](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
i am working on a soccer/hockey style game, and i am having a few problems.
1. how can i stop the blue disk from passing the barriers? and the white disk bouncing from it?
![Image and video hosting by TinyPic](/home/leaving?target=http%3A%2F%2Fi48.tinypic.com%2F2a8opc1.png)
2.how can i make the white disk shot when it hits the blue disk?(just as it would in air hockey)
3.is it possible to make a computer actor/player? if so how hard it is to do that in gamesalad?
1. how can i stop the blue disk from passing the barriers? and the white disk bouncing from it?
![Image and video hosting by TinyPic](/home/leaving?target=http%3A%2F%2Fi48.tinypic.com%2F2a8opc1.png)
2.how can i make the white disk shot when it hits the blue disk?(just as it would in air hockey)
3.is it possible to make a computer actor/player? if so how hard it is to do that in gamesalad?
Comments
1. create a new actor and call it "wall", in the white disk and the blue actor put in the collide behavior and let it collide with the wall actor. Set the bounciness of the white actor to 1 and the bounciness of the blue disk to 0.
Hope it helps you ;D
WTDeveloper
Also, if you want the speed of the ball to vary based on the speed of the guy, create another 2 attributes (real). One named "vel x" and one "vel y". Create a rule in the guy:
When actor overlaps or colides with ball,
Change "vel x" to self.motion.linear velocity x
Change "vel y" to self.motion.linear velocity y
--------------------------------------
In the ball, put
When actor overlaps or collides with guy,
change self.linear velocity x to "vel x"
change self.linear velocity y to "vel y"
--------------------------------------
If you want the ball to fly farther when the guy kicks it, modify the change attributes in the above rule to something like: change self.linear velocity x to (2*vel x).
Good Luck!
P.S. might wanna watermark that image...
i made the wall actor and put it on the side, this is its physics:
-density 1
-friction 3
-bounciness 0
-fixed rotation on
-moveable off
then i put a collide attribute in the blue actor, the blue actor's physics are:
-density 1
-friction 3
-bounciness 0
-fixed rotation on
-moveable on
and a collide attribute in the white disk, the white disk's physics are:
-density 1
-friction 3
-bounciness 1
-fixed rotation on
-moveable off
may the physics be the problem here?
for some reason this didn't work for me either (i assume i am doing something wrong).
in the guy actor i put a constrain attribute: constrain game. player angle(the angle attribute) to self.rotation.
and in the white disk actor i put a rule actor- when actor overlaps or collaides with the guy,
and in it a change velocity attribute that says: direction- player angle(the angle attribute).
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
i just changed the moving method to joystick type movement and it works great now.
but i am still having problems trying to do what @master200012 told me.
no matter from what side i hit it, it always shots right.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS