Just a boring tennis game.
Hopefully, starting from a straight forward concept, I can add a bit of sparkle, a little pizazz, enough to make this not totally suck. We’ll see.
A lot of previously seen concepts (paddles from Bounce Ball Bounce, reflection from Crazy Pong, AI tracking similar to Crazy Pong), but put together with slightly larger smarts. It’s not just about aiming it back anywhere at this end, but enough to make it bounce in the right place (and not out of bounds), plus there’s that nutty tennis scoring.
Ok, have an interesting bounce on the racquets. At this point the enemy AI does exactly nothing. Would be nice to have a gently parallax background – but I don’t think that’s possible with this framework – or maybe just with my current level of knowledge with Haxe.
Man, trig is tricky. Have been trying to get a more interesting game – allow more control over bounce. I spent ages trying to get the horizontal velocity in as a factor (ie, so you could move the paddle left or right to hit it farther or nearer) but wow, no matter HOW I shoved that, I couldn’t get it to work.
Turns out a better approach was to simply use the relative x position on the paddle, and vary not only the x velocity but also the y (up/down).
Right. Tricky things with tennis: defining who gets the points when the ball a) hits the net b) hits the ground c) goes out of bounds, d) goes straight up and back down on the same racquet – relatively straight forward. A lot of rules, but simple enough. Complicated thing? Displaying the bloody score!
It’s done enough for now. It’ll play a game, but no match or set scoring. You always serve. It’s.. a little uninspiring, but kinda soothing in a way. I like the gentle back and forth tennis sounds.