We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Small Basic AI Championship
Hi,

I would expect that 'direct' movement of the ball and paddles by updating their position and handling the 'simple' ball vs vertical-horizontal wall collisions should be faster than the physics engine - it does a lot more calculations handling general collisions with friction and rotations.

For simplicity (and speed) I would use the direct option.

For fun and trying new stuff I would use the physics engine.  In this case I would probably start by setting the paddles as very heavy dynamic objects.  Move them vertically using vertical impulses (google about impulses) - basically they are instantaneous change in momentum (like nudging with a hammer taps) which can be treated like setting the velocity.  Since the mass of the paddles are not infinite, they will react a bit to the ball, but this can be very small which can be corrected by very small position/rotation (teleport) corrections that do not adversly affect the engine physics.  It may also be possible to use joint constraints for the paddles that prevent certain movements, while allowing others (eg. vertical only movement).

Depending how you want to proceed, I can create a small sample code: (case 1 - to check performance on your tablet, or case 2 to consider paddle user control).
[-] The following 1 user Likes litdev's post:
  • AbsoluteBeginner
Reply


Messages In This Thread
Small Basic AI Championship - by AbsoluteBeginner - 09-13-2023, 06:24 PM
RE: Small Basic AI Championship - by litdev - 09-13-2023, 08:18 PM
RE: Small Basic AI Championship - by litdev - 09-14-2023, 11:30 PM
RE: Small Basic AI Championship - by z-s - 04-01-2024, 10:38 AM
RE: Small Basic AI Championship - by litdev - 04-01-2024, 08:13 PM
RE: Small Basic AI Championship - by z-s - 04-02-2024, 09:16 AM
RE: Small Basic AI Championship - by z-s - 04-02-2024, 05:05 PM
RE: Small Basic AI Championship - by z-s - 04-04-2024, 05:16 AM
RE: Small Basic AI Championship - by Scout - 04-04-2024, 02:08 PM
RE: Small Basic AI Championship - by litdev - 04-04-2024, 03:05 PM
RE: Small Basic AI Championship - by z-s - 04-04-2024, 04:30 PM
RE: Small Basic AI Championship - by litdev - 04-04-2024, 05:02 PM
RE: Small Basic AI Championship - by jrmrhrb00 - 04-04-2024, 10:04 PM
RE: Small Basic AI Championship - by litdev - 04-04-2024, 10:13 PM
RE: Small Basic AI Championship - by jrmrhrb00 - 04-04-2024, 11:07 PM
RE: Small Basic AI Championship - by litdev - 04-10-2024, 07:31 PM
RE: Small Basic AI Championship - by litdev - 04-11-2024, 10:03 AM
RE: Small Basic AI Championship - by z-s - 04-11-2024, 02:29 PM
RE: Small Basic AI Championship - by litdev - 04-16-2024, 01:16 PM
RE: Small Basic AI Championship - by z-s - 04-16-2024, 03:04 PM
RE: Small Basic AI Championship - by litdev - 04-16-2024, 05:42 PM
RE: Small Basic AI Championship - by z-s - 04-17-2024, 06:24 AM
RE: Small Basic AI Championship - by z-s - 04-17-2024, 02:28 PM
RE: Small Basic AI Championship - by litdev - 04-19-2024, 07:01 PM
RE: Small Basic AI Championship - by litdev - 04-20-2024, 10:09 AM
RE: Small Basic AI Championship - by litdev - 04-22-2024, 08:24 AM
RE: Small Basic AI Championship - by z-s - 04-23-2024, 06:29 AM
RE: Small Basic AI Championship - by Scout - 04-24-2024, 02:48 PM
RE: Small Basic AI Championship - by Scout - 04-24-2024, 05:55 PM
RE: Small Basic AI Championship - by litdev - 04-24-2024, 08:39 PM
RE: Small Basic AI Championship - by z-s - 04-25-2024, 04:28 AM
RE: Small Basic AI Championship - by z-s - 04-25-2024, 05:19 AM
RE: Small Basic AI Championship - by z-s - 05-01-2024, 06:06 AM
RE: Small Basic AI Championship - by z-s - 05-01-2024, 07:18 AM
RE: Small Basic AI Championship - by litdev - 05-01-2024, 04:24 PM
RE: Small Basic AI Championship - by litdev - 05-18-2024, 01:33 PM
RE: Small Basic AI Championship - by litdev - 06-07-2024, 10:44 AM
RE: Small Basic AI Championship - by litdev - 06-13-2024, 08:03 AM
RE: Small Basic AI Championship - by Scout - 06-13-2024, 05:46 PM
RE: Small Basic AI Championship - by litdev - 06-13-2024, 07:16 PM
RE: Small Basic AI Championship - by litdev - 06-21-2024, 09:35 AM
RE: Small Basic AI Championship - by litdev - 06-21-2024, 12:44 PM
RE: Small Basic AI Championship - by z-s - 06-21-2024, 05:20 PM
RE: Small Basic AI Championship - by litdev - 06-24-2024, 05:17 PM
RE: Small Basic AI Championship - by litdev - 06-27-2024, 08:03 PM
RE: Small Basic AI Championship - by litdev - 06-28-2024, 10:32 AM
RE: Small Basic AI Championship - by litdev - 06-28-2024, 02:16 PM
RE: Small Basic AI Championship - by litdev - 06-29-2024, 08:50 AM
RE: Small Basic AI Championship - by litdev - 06-29-2024, 04:59 PM
RE: Small Basic AI Championship - by z-s - 07-02-2024, 12:21 PM
RE: Small Basic AI Championship - by z-s - 07-02-2024, 02:38 PM
RE: Small Basic AI Championship - by z-s - 07-06-2024, 02:19 AM
RE: Small Basic AI Championship - by z-s - 07-06-2024, 01:02 PM
RE: Small Basic AI Championship - by z-s - 07-06-2024, 04:01 PM
RE: Small Basic AI Championship - by z-s - 07-06-2024, 04:45 PM
RE: Small Basic AI Championship - by litdev - 07-06-2024, 11:07 PM
RE: Small Basic AI Championship - by z-s - 07-11-2024, 02:55 AM
RE: Small Basic AI Championship - by z-s - 07-11-2024, 06:39 AM
RE: Small Basic AI Championship - by litdev - 07-13-2024, 10:53 PM
RE: Small Basic AI Championship - by z-s - 07-14-2024, 03:37 AM
RE: Small Basic AI Championship - by litdev - 07-14-2024, 09:05 AM
RE: Small Basic AI Championship - by z-s - 07-15-2024, 06:16 AM
RE: Small Basic AI Championship - by litdev - 07-17-2024, 08:31 PM
RE: Small Basic AI Championship - by litdev - 07-18-2024, 11:45 AM
RE: Small Basic AI Championship - by litdev - 08-25-2024, 06:44 PM
RE: Small Basic AI Championship - by litdev - 08-26-2024, 08:24 AM
RE: Small Basic AI Championship - by litdev - 09-01-2024, 06:53 PM
RE: Small Basic AI Championship - by litdev - 09-01-2024, 08:25 PM
RE: Small Basic AI Championship - by litdev - 09-02-2024, 01:59 PM

Forum Jump:


Users browsing this thread: 23 Guest(s)