Tom Swirly
Posts: 168
Joined: Tue Sep 25, 2012 1:08 am

pi3d: much neater CollisionBalls demo

Tue Nov 27, 2012 2:28 am

The latest incarnation of the CollisionBalls demo, and IMHO the best yet.

Paddy pointed out in his last code that the whole way of using Sprites was poorly handled in the CollisionBall demo and cleaned it up - but not brutally enough. I got rid of the entire class (that I created!)

1. You can see that the initialization of Display is much simplified.

2. I'm now using a Python decorator to handle closing the program from the keyboard. You don't have to understand how decorators work to use it!

3. And best of all, the return of the user display loop - compare and contrast with the original.

User avatar
Briareos
Posts: 33
Joined: Sun Nov 04, 2012 8:03 pm
Location: Mulhouse, France
Contact: Website

Re: pi3d: much neater CollisionBalls demo

Tue Nov 27, 2012 9:25 am

It would be REALLY cool if we had an entry dedicated to pi3d within this forum.
C'mon admins...

By the way, where can I get the latest git sources for the CollisionBalls demo.
I must admit I'm a bit lost with git forks...

Thanks in advance
--
Jean-Philippe

User avatar
paddyg
Posts: 2529
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: much neater CollisionBalls demo

Tue Nov 27, 2012 12:17 pm

Jean-Philippe

https://help.github.com/articles/set-up-git is step by step set-up and http://gitref.org/index.html is quite good. I can never remember the details (often use up arrow in a terminal then edit what I did before!) but I think you a) install git (probably 'sudo apt-get install git' b) git config (see ref for actual commands) c) make a new directory for this version of pi3d and cd to it d) git init e) 'git clone https://github.com/rec/pi3d.git' or you might need to do 'git remote add origin https://github.com/rec/pi3d.git' first. You can do 'git pull origin master' subsequently to fetch and merge changes once you have 'git remote add origin...' to your directory..

Paddy
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
Briareos
Posts: 33
Joined: Sun Nov 04, 2012 8:03 pm
Location: Mulhouse, France
Contact: Website

Re: pi3d: much neater CollisionBalls demo

Tue Nov 27, 2012 3:01 pm

Thanks Paddy for your answer, I'll give it a look tonight.
My main confusion wasn't specifically about git installation, but merely about which pi3d deposit I should use. There seems to be a least 3 different forks (yours, Tom's and the original one).
Which one is "up-to date" ? (As I understand this is full "work in progress").

Thanks for your advices.
Cheers
--
Jean-Philippe

User avatar
paddyg
Posts: 2529
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: much neater CollisionBalls demo

Tue Nov 27, 2012 3:27 pm

Hi, yes I started with the url to Tom's github then expanded it into a more general explanation. I think the original one (Tim's) at tipam/pi3d is missing quite a few fixes and improvements, some of which I have put onto mine at paddywwoof/pi3d. Tim has recently patched his code and made some improvements but he hasn't yet pushed it up to github. Tom's work at rec/pi3d includes the fixes and improvements from my fork plus a lot more. The work in progress is towards getting images and models to load in background threads but is generally to make the code more structured, resilient and easier to maintain.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
Briareos
Posts: 33
Joined: Sun Nov 04, 2012 8:03 pm
Location: Mulhouse, France
Contact: Website

Re: pi3d: much neater CollisionBalls demo

Wed Nov 28, 2012 12:27 pm

Thanks again Paddy for your answers.
It's way clearer for me now.

Cheers
--
Jean-Philippe

Return to “Python”