@CalebEvans1/

GNoise Algorithm and Example

Pygame

The smoothed randomness function that I am using in this example is a modified version of Ken Perlin's Perlin Noise Algorithm.

fork
loading
Files
  • main.py
  • gnoise.py
  • nohup.out
  • output.txt
  • seededRandomness.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import seededRandomness
import gnoise

import random

seed = seededRandomness.generateSeed(random.randint(0,2**32))

import pygame
from pygame.locals import *

pygame.init()
screen = pygame.display.set_mode((800,800))

base = (400, 510)


running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    screen.fill((0,0,0))
    #for i in range(1):
    #    for j in range(1):
    pygame.draw.ellipse(screen, (255,255,255), [20, 20, 250, 100], 2)
    pygame.display.flip()
pygame.quit()