Jump to content
  • Advertisement
Sign in to follow this  
gatorkea

moving shapes and knowing pixel location?

This topic is 3226 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!