My School Project

This is the place for queries that don't fit in any of the other categories.

My School Project

Postby Titiox » Sun May 11, 2014 12:24 pm

Hi, every body , i'm new on this forum . I'm going to present myself , I'm Thibaut , a french student and I'm 17 years old .
So for my school project I have choose to make a throwing game and I have not the skills to finish it so if you could help I would be verry happy ^^.
(Sorry for my bad english but I've prefered make my own sentences.

My program (the button on the first page are useless , close the first windows to have the second) :

Code: Select all
# Importation des modules
from tkinter import*
from math import*
import random
# Création de la fênetre

pbay = Tk()


pbay.config(bg="orange")



# Logo

photo=PhotoImage(file='ban.gif') # Mauvaise qualité due au gif
LB=Label(pbay , image = photo , relief="raised")
LB.pack(side = TOP , padx = 5 , pady = 45 )

#Button play

bp = Button(pbay, text="Jouer", width=50,height=3, command='' , relief="raised" )
bp.pack(side = TOP , padx = 5 , pady = 25)

#Button simulation

bs = Button(pbay, text="Simulation", width=50,height=3, command='' , relief="raised" )
bs.pack(side = TOP , padx = 5 , pady = 25)

#Button credits

bc = Button(pbay, text="Crédits", width=50,height=3, command='' , relief="raised" )
bc.pack(side = TOP , padx = 5 , pady = 25)

pbay.mainloop()

#######################################################





# Création de la fênetre

master = Tk()
master.config(bg = "orange")

#graph = Tk()
#graph.config(bg = "darkgray")

# Commande de calcul

def callback():
   
     
    res = pow((int(ev.get())/3.6),2)*sin(2*pi*int(ea.get())/180)/9.81
    #res=(((int(ev.get()))*(int(ev.get())))/9.81)*100# Pour 45°
    e.config(text=res )
    #i=0
    for x in range(0,25*int(res)) :
        #y = ((((-0.5*9.81/((int(ev.get()))*(int(ev.get())))*x*x)+x))+80)
        v0=int(ev.get())
        a=int(ea.get())
        y=280-(-0.5*(9.81/pow(v0,2))*pow(x,2)*(1+pow(tan(a),2))+x*tan(a))
        cd=x+10+12
        cb=y+10
        cg=x+12
        ch=y
        id=Can.create_oval(cd, cb, cg , ch , outline="black",fill="orange", width=2)
        'id[x-1].delete'
        'x = int(x+1)'
       

# Repère

Can=Canvas(master, width=500, height=300)
Can.pack(side = BOTTOM , padx = 5 , pady = 5)
id=Canvas(master)
cd=22
cb=290
cg=12
ch=280
id=Can.create_oval(cd, cb, cg , ch , outline="black",fill="orange", width=2)
'Arrete : droite,bas,gauche,haut'

cdp=random.randint(100,480)
cbp=random.randint(75,280)
id=Can.create_oval(cdp,cbp,cdp+30,cbp+30)
# Résultat

e = Label(master)
e.pack(side = BOTTOM , padx = 5 , pady = 5 )

e.focus_set()



b = Button(master, text="Resultat", width=12, command=callback , relief="raised" )
b.pack(side = BOTTOM , padx = 5 , pady = 5)




#Angle

ea=0
ea = Entry(master )
ea.pack(side = BOTTOM , padx = 5 , pady = 5)

ea.focus_set()




la = Label(master, text="Angle", width=12 , relief="groove" )
la.pack(side = BOTTOM , padx = 5 , pady = 5)

#Hauteur Initiale

eh=0
eh = Entry(master )
eh.pack(side = BOTTOM , padx = 5 , pady = 5)

eh.focus_set()




lh = Label(master, text="Hauteur Initiale", width=12 , relief="groove")
lh.pack(side = BOTTOM , padx = 5 , pady = 5)

#Vitesse Initiale

ev = Entry(master )
ev.pack(side = BOTTOM , padx = 5 , pady = 5)

ev.focus_set()




lv = Label(master, text="Vitesse initiale", width=12 , relief="groove" )
lv.pack(side = BOTTOM , padx = 5 , pady = 5)

# Logo

photo=PhotoImage(file='mur_10_h.gif') # Mauvaise qualité due au gif
LI=Label(master , image = photo , relief="raised")
LI.pack(side = BOTTOM , padx = 5 , pady = 5 )






master.mainloop()


Thank you

Thibaut
Last edited by metulburr on Sun May 11, 2014 12:26 pm, edited 3 times in total.
Reason: locked, added code tags
Titiox
 
Posts: 3
Joined: Sun May 11, 2014 12:16 pm

Re: My School Project

Postby Mekire » Sun May 11, 2014 12:38 pm

Could you describe what you are having problems with?

-Mek
User avatar
Mekire
 
Posts: 1012
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: My School Project

Postby Titiox » Sun May 11, 2014 12:43 pm

A list of my problem :
- The trajectory is not correct (angle)
- Connect closing windows buttons
- The graphics
- Does not return the value but to deduce the position of the mouse click

(thanks Google Traduction for the sentences)
Titiox
 
Posts: 3
Joined: Sun May 11, 2014 12:16 pm

Re: My School Project

Postby Kebap » Mon May 12, 2014 8:51 am

Hi Thibaut,

Welcome to the forums and programming python! :)

How much time do you have until you want to finish this project?

Please take a look at the thread for new users, and the links there, etc. This will help us so we can better help you: viewtopic.php?f=6&t=145
Learn: How To Ask Questions The Smart Way
Join the #python-forum IRC channel on irc.freenode.net and chat with uns directly!
Kebap
 
Posts: 397
Joined: Thu Apr 04, 2013 1:17 pm
Location: Germany, Europe

Re: My School Project

Postby Titiox » Mon May 12, 2014 5:12 pm

I have a week to finish it , for me it's very short because i've done the rest of the programme in 3 month .
Thanks for the link , i go see it after this post :)
Ask me for others question , thanks.

Thibaut
Titiox
 
Posts: 3
Joined: Sun May 11, 2014 12:16 pm


Return to General Coding Help

Who is online

Users browsing this forum: metulburr, W3C [Linkcheck] and 6 guests