Archive: Paddlewar/Pong in AVS with mouse control


13th February 2004 17:01 UTC

Paddlewar/Pong in AVS with mouse control
Hi there :)
I made a paddlewar AVS a while ago without mouse control and now added mouse control to it. It's not really great but maybe someone likes it :)
you can't beat the comp (yet) because it *erm* has good reactions :p


13th February 2004 17:10 UTC

hehe, nice!
i'd add keyboard control for the second paddle, so you can play it against someone who has *err* not so good reactions.


13th February 2004 17:32 UTC

Um, I think you kind of misunderstand the game of pong. The point is that the paddles move slowly, and that you can deflect the ball at sharp angles so your opponent can't reach it anymore.

The player's pad tracks the mouse instantly, and the computer tracks the ball instantly.

The ball should also deflect depending on the vertical position along the paddle where it bounces (as if the paddle was curved): otherwise there is no way to make it difficult for the opponent.


13th February 2004 17:49 UTC

Yes i know but that's hard to do with mouse control.
I could do this in 2 different ways:
1. The pad tries to follow the mouse as fast as possible (limited somewhere) until it is where the mouse is.
2. The pad moves when the mouse moves.

I think neither of these options would be the optimum but it think i'm going to implement the first option.


13th February 2004 22:43 UTC

The first way would be better something like this

pad_pos=pad_pos*.9+mouse_pos*.1 - change the values to change the speed of the reaction(just make sure they add to 1). That should work fine. Or you could just do keyboard controls.


14th February 2004 00:17 UTC

Exponential decay would be weird. Just do: pad_pos=if(above(abs(mouse_pos-pad_pos),speed),pad_pos +speed*sign(mouse_pos-pad_pos),pad_pos);


14th February 2004 15:45 UTC

You could either: fix the game or add trippy colours so people won't notice.

You should also put some kind of delay on the reaction time of the computer paddle. About half a second might work.


23rd February 2004 10:37 UTC

Hm, I've tried myself.
It's multiplayer Pong (one uses mouse, one keyboard)
Tell me how you like it.
I will add some powerups, but for now you can just play the basic pong.