• Advertisement
Sign in to follow this  

moving shapes and knowing pixel location?

This topic is 2955 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello im new to gamedev.net , i have been trying to learn how to program , using python, im following the Bucky tutorials on youtube.
He didnt go very far with the pygame tutorials, and what im trying to figure out is how to get a shape that u draw on the screen using the rect or draw methods. and be able to use it as an object to move it around on the screen. I understand how to call a png file to use in this way, but not using a shape that i have drawn. Second question, is there a way to know exactly where im placing shapes/lines when i make them? im basically plugging in random numbers for my parameters to draw my shapes. this is the code for which im working with at the moment. import pygame, sys from pygame.locals import * pygame.init() screen=pygame.display.set_mode((640,360),0,32) color=(230,170,0) position=(300,176) radius=(60) while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() screen.lock() pygame.draw.circle(screen,color, position,radius) screen.unlock() pygame.display.update()

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement