Compleated Begginers Guide. Now What?

J

Jay

I have compleated the beginers guide to python
http://www.freenetpages.co.uk/hp/alan.gauld/.
then i found the Toolkit Tkinter and started on that. its graight and
av made lots of apps to help me with litle things but i have a big
problem. the CLASS method.

when i seperate things up into classes i carnt get one class to tell
the other class somthing. it just opens another coppy of the class. i
am confused.

oh and i carnt fathem out how to run to loops at the same time. EG .
Ball Blaster i wanted to permenetly run the ball with a loop well my
main loop ran the bat.

can sumone point me to the right studeing material.
 
M

Martin Christensen

Jay> when i seperate things up into classes i carnt get one class to
Jay> tell the other class somthing. it just opens another coppy of the
Jay> class. i am confused.

I'm sorry, it's very difficult to understand what you mean. You'll
have to be a lot more precise, and it would probably help if you
posted code examples and tell us what you expect from the code you're
making.

Jay> oh and i carnt fathem out how to run to loops at the same time.
Jay> EG . Ball Blaster i wanted to permenetly run the ball with a loop
Jay> well my main loop ran the bat.

Erm... it _could_ sound as if you're looking for multi-threading, i.e.
running several things at the same time. This, however, is pretty
difficult, especially for a beginner. Maybe you should try to
structure your program differently so that you only need one thread of
execution. Then you can proceed to multi-threading when you have more
experience.

Martin
 
J

Jay

Thank you Martin Christensen and i am sorry for not explaning well. i
will tack that advice
 
M

Mirco Wahab

Jay said:
> I have compleated the beginers guide to python
> http://www.freenetpages.co.uk/hp/alan.gauld/.
> then i found the Toolkit Tkinter and started on that. its graight and
> av made lots of apps to help me with litle things but i have a big
> problem. the CLASS method.

Ledds viddy, my droog - you tried to rabbit
hard but diddnt get your horrorshow? So you
start platching here?
> when i seperate things up into classes i carnt get one class to tell
> the other class somthing. it just opens another coppy of the class. i
> am confused.

Malchick, you cracked your veshchs to classes, which is
not that gloopy. So rabbit on them and add class methods
that sloosh on beeing called and do the proper veshchs
to the gulliwuts of their classes.
> oh and i carnt fathem out how to run to loops at the same time. EG .
> Ball Blaster i wanted to permenetly run the ball with a loop well my
> main loop ran the bat.
> can sumone point me to the right studeing material.

All TK-lewdies here will creech 'callback' at you sth. So
prod your working TK app by rabbit out a 'callback domy',
just filly around with this
http://effbot.org/zone/wck-2.htm#handling-user-events
or that
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/464635

Tolchock it,

M.
 
J

James Stroud

Mirco said:
Jay wrote:
Malchick, you cracked your veshchs to classes, which is
not that gloopy. So rabbit on them and add class methods
that sloosh on beeing called and do the proper veshchs
to the gulliwuts of their classes.

Brillig!


--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/
 
D

Dennis Lee Bieber

when i seperate things up into classes i carnt get one class to tell
the other class somthing. it just opens another coppy of the class. i
am confused.
Typically, you don't tell a "class" to do anything... Normally you
create "instances" of each "class", and tell the instance to do
something.

And the only way to have one instance tell another to do something
means the first instance has to know about the other... (My apologies,
this is a very simplistic description).
oh and i carnt fathem out how to run to loops at the same time. EG .
Ball Blaster i wanted to permenetly run the ball with a loop well my
main loop ran the bat.
Use ONE loop for both; the loop controls the "time"... Then pass the
event "time" to each object.

T = 0
while True:
T = T + 1
aBall.update(T)
aBat.update(T)
if aBall.position() == aBat.position():
#it's a hit
#Probably better to pass the ball position
#to the bat, and let the bat figure out if it
# was a hit -- since the ball is a sphere but
# the bat is a cone, you only need the ball
#center and radius, but much more data
#for the bat.

can sumone point me to the right studeing material.

For the first... Check for any introduction to OO design, OO
modeling, OO programming.

For the second... Discrete event simulation? Books on game
programming.
--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top