Aug-24-2021, 11:30 PM
(This post was last modified: Aug-24-2021, 11:30 PM by CompleteNewb.)
okay, okay, okay,
first of all thank you for your time.
The blue fill is great and the post about making it move got me thinking and it kind of blew my mind so i tried writing it myself, but it didn't work...
So here's what i have now. In my head it should be working. You augment the degrees and the math function should do the trick???
first of all thank you for your time.
The blue fill is great and the post about making it move got me thinking and it kind of blew my mind so i tried writing it myself, but it didn't work...
So here's what i have now. In my head it should be working. You augment the degrees and the math function should do the trick???
import random, pygame, math, sys from pygame.locals import * Blue = (0,0,255) Black = (0, 0, 0) Green = (0,255,0) White = (255,255,255) pygame.init() DISPLAYSURF = pygame.display.set_mode((400, 300)) pygame.display.set_caption('Sailing!') FPS = 30 fpsClock = pygame.time.Clock() Sail = pygame.Surface([100,10]) Sail.set_colorkey (Black) Sail.fill(White) degrees = 0 hyp = 100 x = 200 y = 150 while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() adj = 100 * math.cos(degrees) opp = 100 * math.sin(degrees) dx = adj + 200 dy = opp + 150 sadj = math.pow(adj, 2) sopp = math.pow(opp, 2) shyp = math.pow(hyp,2) rotatedSail = pygame.transform.rotate(Sail, degrees) Sail_rect = Sail.get_rect(topleft =(dx,dy)) DISPLAYSURF.fill(Blue) DISPLAYSURF.blit(rotatedSail, Sail_rect) pygame.display.flip() fpsClock.tick(FPS) degrees += 1