Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Roung [Version 0.1]  (Read 5073 times)

0 Members and 1 Guest are viewing this topic.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Roung [Version 0.1]
« on: November 01, 2013, 08:53:20 pm »
Introducing..... [drum roll].... Roung!

Well OK, it is not that big of a deal. Roung is your standard Pong game, except the paddles move in a circular direction instead of straight up and down. I started this just yesterday when it came to me how simple it would be to implement collision for this type of movement. As you can see in this thread Jycerian wanted to implement a circular Pong game, but was having issues with collision.

The way my collision works is simple, To determine if the ball has collided I follow these steps
  • Determine if ball is lined up with a paddle - Ball angle from the center field +- the angle of the paddle
  • Check if the ball is close enough to collide with the paddle - Distance from center field to ball
  • If it is, bounce the ball

Since I wrote it more as an example than anything, you can get the full source code from here.
https://bitbucket.org/zsbzsb/roung/

Roung was written using SFML.NET (for graphics/window/input) and NetEXT (for input handling/vectors/time/math). The controls are the 'Left' and 'Right' arrow keys for player 1, 'A' and 'D' keys for player 2. If you want to toggle AI on and off use the 'Asterisk' and 'Num+' / 'Num-' for changing the AI difficulty.

You can get some precompiled binaries from here if you just want to try it out.

If you have any questions or comments please let me know.  :)


« Last Edit: November 01, 2013, 09:04:49 pm by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Roung [Version 0.1]
« Reply #1 on: November 02, 2013, 01:24:37 pm »
Luckily I didn't fell asleep while playing, so I can still give some feedback... ;D

Make the ball faster! ::)
Some AA would make the circles look a bit nicer.

It seems like you didn't fix one of the issues mentioned in the other thread, but maybe you consider it as "intended" game play, but you can essentially make a certain point for yourself, because the other player can't reach the ball. If it's intended then one would have to given points regarding location, e.g. if it goes out on my side the other gets a point and the other way around. Or allow full movement freedom, so there isn't any "my side" or "your side". ;)

Nice that you followed up on the idea though, I quite liked it from the other post. :)
« Last Edit: November 02, 2013, 01:26:36 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything