Python Forum
creating an object at another objects position
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
creating an object at another objects position
#7
I didn’t mean for my last statement to seem sarcastic, I should have worded it as, if I am not supposed to do this with Tkinter that is fine, I am also interested in pygame, I just don’t understand how a friend of mine got it done. (He doesn’t have the time to explain everything to me).
but I finally got it.
And laser is a instance of the Laser it stores the update method in each instance and that can be iterated Over with a for loop. At least that’s how I understood it.

def fire(self):
    p = canvas.coords(self.id)
    Laser(p[0],p[3],self.dx,self.dy
while True:
    r.mainloop()
    r.update()
    for laser in Laser.lasers:
        laser.update()
        time.sleep(.1)
Reply


Messages In This Thread
RE: creating an object at another objects position - by gr3yali3n - Feb-28-2021, 03:04 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020