The Daily Click ::. Forums ::. Klik Coding Help ::. Ball passing through objects?
 

Post Reply  Post Oekaki 
 

Posted By Message

sententia



Registered
  20/09/2005
Points
  162
10th October, 2005 at 18:41:13 -

Im working on a pinball game in TGF right now, and the ball sometimes goes through the flippers or ramps. Anyone have any ideas as to why this could be happening.

 
n/a

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
10th October, 2005 at 20:50:06 -

you need to be more specific, it could be any number of things, narrow it down a little and somone should be able to help

 
n/a

sententia



Registered
  20/09/2005
Points
  162
10th October, 2005 at 21:53:00 -

Well, the flippers have 3 animations; stopped, walking, and running. Stopped ia in the down position, and the ball isnt passing through when stop is playing (looping). Walking is when its rotating up, and running is when it's in the up position (looping).

I modified the bouncing ball movement since theres no pinball movement in TGF. Here are the conditions with the flippers (only left flipper):

Upon pressing left:

-Change animation to walking

Animation Walking is over
Repeat while left arrow is pressed

-Change animation to running

(Negated)Repeat while left arrow is pressed

-Change animation to stopped

Animation walking is playing
Ball collides with flipper

-Bounce Ball
-Set speed of ball to (Speed of ball + 20)

Animation running is playing
Collision between ball and flipper

-Bounce Ball

Only once when event loops
Animation stopped is playing
Collision between ball and flipper

-Set speed of ball to (speed of ball - 20)
-Set direction of ball to 31 (Rolls down flipper)

 
n/a

sententia



Registered
  20/09/2005
Points
  162
10th October, 2005 at 21:53:26 -

Is that specific enough?

 
n/a

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
10th October, 2005 at 23:02:30 -

specific enough!
hmmm, im not familiar with TGF but it may have somthing to do with the built in movement, The ball movement is extremly buggy and if you mix that with collision whilst animating, that could be the problem.
from what you have written there its should work but i would seriously suggest leaving the ball movement and try creating a custom movement that doesnt allow this to happen, especially for a pinball game.
The major problem with the built in movements is the unexpected outcome of certain situations.
Sorry i couldnt nail the actual problem, if anyone has a better explenation, listen to them.

 
n/a

kjarom



Registered
  08/06/2004
Points
  805
11th October, 2005 at 09:55:29 -

If nothing else works, try using collision markers on the ball (I'm assuming you know what those are).

 
You now rockin wit a pro

Dave Matthew (Jester Gaming)



Registered
  09/07/2004
Points
  148
11th October, 2005 at 12:10:48 -

I think it happens when the flipper is animated. Cause then the flipper might just "jump" over the ball. Depends on how many animation frames you use though.

 
n/a

sententia



Registered
  20/09/2005
Points
  162
11th October, 2005 at 14:53:48 -

Theres 5 frames in the walking animation, and each one rotates by one point, so I don't see how that would be the problem. And also, sometimes it goes through the flipper while its in the up position.

@Kjarom - Wouldnt I use the collision markers on the flippers (not the ball)?

@LegendKprDos - I need pinball because it goes with all of the other games in this game, but pachinko would be a little boring anyways?

@Antworx - Youre probably right about the ball movement, but if Id have to create a whole physics engine to make a custom movement for pinball =/.

Image Edited by the Author.

 
n/a

kjarom



Registered
  08/06/2004
Points
  805
12th October, 2005 at 07:57:15 -

Well, in the long run it'd be easier just to make them for the ball; the ball is going to be bouncing off of many other things besides the flipper, and collision markers just make any game smoother.

But hey, put 'em on the flippers too. Doing so will probably eliminate your glitch.

 
You now rockin wit a pro
   

Post Reply



 



Advertisement

Worth A Click