Results 1 to 5 of 5

Thread: Arkanoid: paddle/ball movement theory and math

  1. #1
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Arkanoid: paddle/ball movement theory and math

    Hi,

    I was playing last night with Arkanoid script and thinking about what could be the theory and math behind the interaction between the paddle and the ball.

    For a good interaction and being able to apply to the ball some nice and precise effect, direction, control, I think more variables are to be taken into consideration:
    • angle of the ball
    • direction from where the paddle was coming just before hitting the ball
    • place inside the paddle where the hit with the ball take place (center, left side, right side or other subpart of the paddle)


    Even imagine that the ball can have its own effect so another info we can add to the ball is: current effect, I mean the rotation of the ball on its own axes. When the ball hit a brick or the paddle with a local rotation, this will influence the next angle/rotation.

    Just brain storming with myself.
    What do you think?

    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  2. #2
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    160

    Re: Arkanoid: paddle/ball movement theory and math

    I did notice that when i played it the collision was wrong, if you are lined up with a block and fire the ball without moving it should hit that block and come straight back at you, not shoot off at a right angle away from you.

    I think traditional game only did angles if you release the ball while the paddle is moving.

    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: Arkanoid: paddle/ball movement theory and math

    Abraxas,

    current version just apply a random angle to the ball when it hits the paddle.
    That's the raason why I made this post because ball movement and its math is an important point for this project.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: Arkanoid: paddle/ball movement theory and math

    There is an interesting Arkanoid clone written in Python at http://www.scriptedfun.com/arinoid-an-arkanoid-clone/
    I tested it. It can be a nice study for ball movements.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Re: Arkanoid: paddle/ball movement theory and math

    Hi,

    more mathematically correct bouncing sounds good to me.
    I am still experimenting with that exact breaking of bricks to pieces ( = totally irrelevant stuff, but would be interesting ).

    Thanks for the Python sample, looks good. I just ... don't want to see any Python code for a few light years, I enjoyed it too much for my bac. thesis ;D


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Similar Threads

  1. Electronic theory
    By Michael Clease in forum General
    Replies: 1
    Last Post: 13-02-2009, 14:19

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •