Added: 1 year ago
From: phyces
Views: 4,190
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (24)

Sign In or Sign Up now to post a comment!
  • ok so this is a out of date or something tut- everyone is getting the same error - im gonna say i understand how it should work and mostly why- but im gonna move on cuz obviously its not working for me.

    im sure versions are different - but they do not offer the 2.5.6 for windows anymore - just for linux

    - python 2.7.2

    -pygame 1.9.1

  • Comment removed

  • for some reason when I try to execute startcode.py, I just started getting an error saying s=Starter() is invalid

    it wasn't happening before, and it's also happening with your final code version

  • To fix the error, i recommend just assigning another variable in draw, for example self.posint = (int(self.pos[0]), int(self.pos[1])) and then use self.posint in the draw, or whatever you want to call it. since redefining self.pos to int would screw other things up

  • What are the parameters for the key input? Is it the arrow keys alone? Cause I've been at this for some time now, but I don't know the right integers for using the 'KeyUp' function. I don't think I ever saw a tutorial for it anywhere.

  • Nice tutorial but I don't get how dir.length works

  • @xFelicianoX that's a fair complaint, I should have been a bit more clear on this. When you do dir.length = 3, behind the scenes Python does something like dir.setLength(3) . And that function does a few things: it computes the length of the dir vector, and then it divides each component by this length, and then multiplies each component by the 3. The result being that dir.x and dir.y are pointing along the same direction, but dir is now a length of 3. Bit of vector math

  • @Hobben93

    @faithfulnathan

    self.pos.inttup() converts the vec2d item into a integer tuple

    Found this when i was exploring the vec2d module

  • @Dragonno96 Thanks for the tip, that fixed the TypeError problem.

  • Hi. Great tutorials.

    However, I got a TypeError: Integer argument expected, got float. (line 37)

    Draw is expecting an Integer, but Vec2d is returning a float. How do you get it to work?

    (for the record I'm using Python 3.1, and Pygame 1.9.1)

  • @faithfulnathan i have the same problem, plz respond

  • @Hobben93 Found this fixed the problem:

    - In Class Starter, in the Draw(draw) method, change 'self.pos' to '(int(self.pos[0]), int(self.pos[1]))'

    ie. pygame.draw.circle(self.screen­, (0,0,0), self.pos, 21) to pygame.draw.circle(self.screen­, (0,0,0), (int(self.pos[0]), int(self.pos[1])), 21) and pygame.draw.circle(self.screen­, (200,200,255), self.pos, 20) to pygame.draw.circle(self.screen­, (200,200,255), (int(self.pos[0]), int(self.pos[1])), 20)

  • @faithfulnathan I keep getting the same problem. DX

  • how do you use an img for the player?

  • Awesome tutorials!

  • You are an excellent teacher! I'd love it if you could read through the starter code files and explain them because this just looks too easy to follow.

  • Excellent as always! I just have a question, I tried to control the ball with the keyboard, using both keyDown and keyUp, but if I hold the button on the keyboard it stops moving. What am I doing wrong? Tks!

  • Great tutorial. Please make more of these. I myself would like to learn more about how to handle boundaries and collision detection :)

  • Comment removed

  • Game maker is fun, it's less "programming" but more a program which you use to create games. Try it if you want :3

  • @AwdioSurfer Less programming means less features though.

  • @XAutomatedOwnerX I know, but I mean "less" as in it's "click and drag" in game maker, but here you have to type it all out

  • @AwdioSurfer Ooooooh well i like writing the code myself :) but yah i can see how some people would like that.

  • Comment removed

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more