Re: Can anyone help me modify the code so the ball starts in random directions

2015-12-11 Thread phamtony33
On Friday, December 11, 2015 at 7:55:59 PM UTC-5, Steven D'Aprano wrote: > On Sat, 12 Dec 2015 10:19 am, phamton...@gmail.com wrote: > > > Can anyone direct me in the direction where to start the code for the > > randomized of the ball to start. > > [...] > > move_ball(-10, 7, 0) > > > That s

Re: Can anyone help me modify the code so the ball starts in random directions

2015-12-11 Thread phamtony33
from Tkinter import * window = Tk() canvas = Canvas(window, width=500, height=500, background="green") canvas.pack() def mouse_paddle_move(event): mouseY = event.y current_coords = canvas.coords("paddle") x1 = current_coords[0] y1 = current_coords[1] x2 = cu

Can anyone help me modify the code so the ball starts in random directions

2015-12-11 Thread phamtony33
Can anyone direct me in the direction where to start the code for the randomized of the ball to start. from Tkinter import * window = Tk() canvas = Canvas(window, width=500, height=500, background="green") canvas.pack() def mouse_paddle_move(event): mouseY = event.y current_coo

How to bounce the ball forever around the screen

2015-12-03 Thread phamtony33
from Tkinter import * window = Tk() canvas = Canvas(window, width=500, height=500, background="green") canvas.pack() def move_ball(speed_x, speed_y): box = canvas.bbox("ball") x1 = box[0] y1 = box[1] x2 = box[2] y2 = box[3] if x1 <= 0:

Re: Converting a string into a float that includes the negative

2015-11-07 Thread phamtony33
On Saturday, November 7, 2015 at 9:40:49 PM UTC-5, MRAB wrote: > On 2015-11-08 02:11, phamton...@gmail.com wrote: > > I am having issue with converting the string into a float because there is > > a negative, so only end up with "ValueError: invalid literal for float(): > > 81.4]" > > > > def con

Converting a string into a float that includes the negative

2015-11-07 Thread phamtony33
I am having issue with converting the string into a float because there is a negative, so only end up with "ValueError: invalid literal for float(): 81.4]" def contains_words(word,msg): if word in msg: return true else: return false