Tuesday, October 28, 2014

Final destination. Industrial

I think they should do the next final destination as one long premonition.  In some sort of large, spooky, scary industrial complex.  Lots and lots of ways to gruesomely rip people apart.  Or smush em, or electrocute them, or make em fall...  So they can set it up,  alarms going off, and then our lone hero has to stop the catastrophic failure of his machine/department.  Then things just keep going wrong, and people keep getting slaughtered, and then by the end of the movie, he wakes up and realizes it's a premonition and then just keeps doing his job anyways.... Ta da, the end. 
I really think it would be a nice twist on the story. 


Anyhoo, before they use my idea, and I get no credit.  LOL.

~Nellie Tobey

Friday, August 29, 2014

chaos theory

She wondered most of the time, what the fuck was the point?

Life hurries by and all one has to show for it is stuff, and heavy and burdening relationships with others.

That is why they could not find her.  That is why she still existed.  Chaos in it's human form was not only polite, but also disturbed.  Belligerent and charming.  One never knew what to expect from this stranger, but one knew to not expect anything in particular.

It could be male, it could be female.  As long as the path always steadily and dramatically changed like a strange algorithm for things that shouldn't exist.  Paradox's within the world.  A child of scorn, a child of happiness.  It would never make sense as long as the chaos ensued.  And as long as it didn't make sense, there was no legitimate reason to hold claim to the damage that was ravaged across the landscape of mankind.

Who would Ghandi be without violence?  Who would Hitler be without humanity?  They would be impotent figures without their subsequent opposing forces.  Chaos ruled with not only a fine line of logistics, but also a large and overpowering tide of unnerving instability.

She would rule the world if not for the need to stay quietly in the distance, changing, influencing and directing the world about her.

The only problem was,  some noticed.  Some saw the rhyme and reason in it all.
They were the true threats to reality, and they were to be demolished at the first possible chance.

Chaos hates being recognized more then it can feasibly stand tolerance.    Humans: greatest ally and also greatest enemy.  What was love without hate?  A mere shift in the ablity to detect ugly in the world.   What was anger without retribution?  But a coward without the ability to make aggressions known.   What was righteous without the unreligious, but a side dish for the benevolence of the world to feast upon.

So to fight it, we ignore it.  To co-exist with it, we ignore it.  Chaos exists people.  Embrace it, and become friends with it, or parish in the much anticipated zombie Apocalypse.  After all, what good is everything evolving if there is nothing to keep it moving forward?  And by forward I mean an unleashed terror of things that could cripple society from within.    We are a creature of society, and without it so many are lost in the linear movement of time.

And so goes my bad guy of my story.   Work in progress, hopefully.  Chaos seems to intervene on me more then I'd like, and I seem to be silently and without notice, be thrown to the winds without much ado.  Because that's the way things are supposed to be.  You do your part in society or everything is wrong.  Everything falls apart.
Fuck the world.  For the win.

WOOOOO.
G'Night. 

Thursday, July 17, 2014

INVENTORY, EQUIPPING AND STORING PYTHON

#Came up with this for
#storing, and equiping items in python


inventory = []
armor = {"head": "rags",
    "torso":"rags",
    "arms":"rags",
    "legs":"cloth",
    "feet":"sandals",
    "special":"ill-concieved necklace"}
equipment = ["armor_head", "armor_torso", "armor_arms", "armor_legs", "armor_feet", "armor_special"]
item_armor ={
    "armor_head":["rags", "leather hat", "diamond plate helm"],
    "armor_torso":["rags", "leather armor", "diamond plate armor"],
    "armor_arms":["rags", "leather bracers", "diamond bracers"],
    "armor_legs":["cloth", "leather pants", "diamond pants"],
    "armor_feet":["sandals", "leather shoes", "diamond shoes"],
    "armor_special":["ill-concieved necklace", "charming bracelet", "lucky ring"]
}
def store_item(item):
    inventory.append(item)

def equip_item(item1, item2):
   
    if equipment.__contains__(item1):
       
        if "armor_head" == item1:
            old_item = armor["head"]
            store_item(old_item)
            armor["head"] = item2
            inventory.remove(item2)
           
        if "armor_torso" == item1:
            old_item = armor["torso"]
            store_item(old_item)
            armor["torso"] = item2
            inventory.remove(item2)

        if "armor_arms" == item1:
            old_item = armor["arms"]
            store_item(old_item)
            armor["arms"] = item2
            inventory.remove(item2)

        if "armor_legs" == item1:
            old_item = armor["legs"]
            store_item(old_item)
            armor["legs"] = item2
            inventory.remove(item2)
    else:
        print "item is not equipable"

stats = {
    "basedefense": 2,
    "strength": 3,
    "hit": 2,
    "armor": 4}
battlestats = {
    "defense" :   stats["basedefense"] + stats["armor"],
    "attack" : stats["strength"] + stats["hit"]
}
def updatestats():
   

    if armor["head"] == "rags":
        stats["armor"] = stats["armor"] +1
   
    if armor["head"] == "leather hat":
        stats["armor"] =  stats["armor"] +3

def updatebattlestats():
    battlestats["defense"] =   stats["basedefense"] + stats["armor"]
    battlestats["attack"] = stats["strength"] + stats["hit"]
   
    #else:
        #print "Not Working"

   
       
# I can use the 'hashtag' to take out the parts of the test I don't need   
   
def runtest():
    store_item( "leather hat")
    store_item( "leather armor")
    store_item( "leather pants" )
    store_item( "leather bracers" )
   
    #print armor
    #print inventory

    equip_item("armor_head", "leather hat")
    equip_item("armor_torso", "leather armor")
   
    #print armor
    #print inventory

    print stats
    print battlestats
    #print attack
    updatestats()
    updatebattlestats()
    print stats
    print battlestats
   
   

runtest()

Tuesday, June 24, 2014

Rainbows! Also a while loop tuple.

##  My while loop tuple.  Could x y z represent coordinates?


import pygame
from pygame.locals import*
import math
from sys import exit
from random import randint
R = 2
G = 0
B = 0


def run():
    pygame.init()
    screen= pygame.display.set_mode((800, 800))
       
    clock = pygame.time.Clock()
   
    while True:
       
        for event in pygame.event.get():
            if event.type == QUIT:
                exit()
   
       
        x = 2
        R = 0
        G = 0
        B = 0
        y = 0
        z = 0

        while (x > 1):
       
            R = R + 51
            G = 0
            B = 0
            pygame.draw.circle(screen, (R, G, B), (200, 200), 100)
       
            clock.tick(2)

            pygame.display.update()
            if R == 255 :
                y = 2
                x = 0
        while (y > 1):
            R = 0
            G = G + 51
            B = 0
            pygame.draw.circle(screen, (R, G, B), (200, 200), 100)
       
            clock.tick(2)

            pygame.display.update()
            if G == 255:
                z = 2
                y = 0

        while (z > 1):
            R = 0
            G = 0
            B = B + 51
            pygame.draw.circle(screen, (R, G, B), (200, 200), 100)
       
            clock.tick(2)

            pygame.display.update()
            if B == 255:
               
                z = 0



           
run()

Saturday, June 21, 2014

Bastille Short







 Ecape from Bastille
short story by: Nellie Tobey
edit #5: 12-26-18


 By the roadside, on an overused stretch of county blacktop, she walked. She was early-twenties, tall and thick.  She was large and intimidating, like a frontier woman that split her own wood, and knocked her own cattle.
  She was not sure when her long walk had begun, and if she turned around and walked the other way, she was quite convinced that she would spend a long while walking and forget that she had turned around. She knew she was called Brit or Brittney, but that was all that would stick to the tephlon in her mind.
  An old beat up rusty thing of a Ford passed in a hurry, carrying behind it a a rickety, clattering old trailer.
  Brit had an annoying habit of envisioning terrible things that would happen out of random, un-linked chains of events occurring around her.
  She imagined the truck driving by once again but this time it would hit the large pothole behind her, and the trailer would plow vertically toward her un-yeilding waist and crush her pieces and bits into the ditch.
  Sometimes the images would catch her mortal side's attention and she would be disgusted by her own train of thought.
  Other times her mortal side stayed silent and let her believe it would be a simple, painless, forgiving way to exit the world.
  After walking another mile, the clouds thickened in the sky and rain felt imminent.  A large freshly painted wood billboard sat two or so feet off the ground in an overgrown patch of weeds. Weeds that had been allowed to germinate and populate the area around the sign for a negligent amount of time. A thought crossed into Brit’s silent mind. Maybe the sign was important, the weeds seemed to think so.
  When Brit got closer, she inspected the sign.  At that moment she could not recall seeing a single road sign, speed limit sign, or any sort of milestones indicating a town.
  Granted she could not remember what had occurred five minutes ago on some occasions, but this felt more profound.
  Brit did what she was good at doing when abnormalities in her reality rose-up and squashed them down with "Does it really matter?"
  Standing in front of the billboard, she inspected it. In large white letters against a red and black background, 'Welcome to Bastille'.  Below that, smaller letters "leave all or leave nothing" and in even more subscript "Mayor A. Albert : 2003"
  Brit took a step out and looked for houses, lights, signals, some marker of civilization, but could see none.
  She imagined the town was either very far ahead, or off the main road like some hidden tree fort in the woods.
  Brit decided to keep walking forward.  After a few nice cars passed her going in what seemed to be the direction of the town, Brit had once again the strange feeling there was no direction she could choose that would lead her to where she needed to be.
Buildings started to take form in the distance after she crested a steep hill.
  The town ahead was hazy from the fine mist of water invading the sky.  It appeared to be some modern version of an old west town.  Large blocky buildings with large grand fronts declared: "Penny Store" or "Tools and Sundry".
There was even what looked to be an old time movie theater complete with defective marquee, and rotary doors.  It appeared to be the most dated structure along the boardwalk.
  Something Brit would notice and disregard would be that all the buildings were built of concrete cinder-blocks. It was built to look old, but most construction was not aged beyond two decades.
  There were nice cars, newer cars, and cars that belonged in the junk yard lining the sides of the street.
  They looked as if they had not moved in some time, and as slow fat rain drops plopped onto them, dust gathered in muddy streaks in the culvets.
  There were people who were bustling in and out, some like beautiful people from the movies ignoring her presence as if she were invisible.  Other people regarded her with curiosity, which left a disturbing coldness in Brit. She stopped looking around and watched the ground move beneath her.
  Brit did not think she deserved curiosity.  She was not an alien or a particular foreign looking person.  She wasn't dressed in any extreme.  She was in a plain white sweatshirt hoodie with a logo on it she did not know, and worn out jeans. She didn’t remember her reflection, but she was certain it had no qualities of consequence.
  Brit pushed the thought aside and kept walking. Maybe there was a public Bathroom.  She couldn't remember when last, or how she had urinated but at the moment her bladder strained inside her like an over-inflated balloon.
  She noticed too that no one got in or out of those cars even though  it was beginning to rain more heavily.  Brit watched her feet for a bit, focusing to keeping the strangers out of her thoughts.  A moment of confusion and she looked up from the now puddled sidewalk and the people had seemed to clear the town.  A couple large blue umbrellas lingered far ahead of her, and a red one with a rushing patron was too her right across the street.
  A plump white haired, gentle man stuck his neatly fuzzed face out of a door in front of her nearly smacking her in the nose with it’s clean clear surface.
  Small fast drops drizzled on his bald patch from the header of the door. He snorted a little, then apologized to Brit. "Oh I'm so sorry!"
  He did not however get out of the way and go back in to the store closing the door, but stood there blinking, "Would you like to come in?"
  Brit figured that with his invitation might come a bathroom pass of some sort.
  Brit shook her head like a floppy eared dog.  Her shoulder length waves shook about.  She realized that he might think she meant 'no', then as if she hadn't used her own voice in a long time, which she suspected was true, she said "Oh yes, yes please. I need a restroom."
  The man stepped out of the way then, letting her into the tiny little store.  It was full of non-essentials and souvenirs with "Bastille" on them.
  The man pointed to the back of the shop.  A straw hatted scarecrow man hung from one door and the other had a flower adorned scarecrow with large pouty eyes.
  She walked in and was assaulted by the smell of disinfectant.
  It was scented with something like lavender.  But to say such would be an insult to lavender. Pulling her pants to her ankles and opening the floodgates, Brit for a moment remembered dizzy sleepy nights wandering into the dark bathroom in the middle of the night to pee. The warm sleepiness of it conflicted with the room she now squatted in. The thought flittered away before she could latch on to anything meaningful.
  Sometimes the things in her mind were like bits of movie you see when channel surfing.  There's a tiny bit of recognition in the character or the scene, but it ends with a 'click' and the T.V. moves on to the next channel.
  Adjusting her pants so that they wouldn't so easily meander down her waist, she flushed the toilet and exited the smell ridden restroom and walked out to see the mid-sized gray and stern faced man still standing by the front door.  As if he was waiting for something, he just stood looking out.
  Brit pretended to look at some of the memorabilia; strange little forts, knights, jousters, and a bumper sticker that said "Now leaving asylum!"
  Brit didn't want to startle the old fellow but he still blocked the door.  Although Brit didn't like the idea of getting soaking wet in the rain, the thought of standing still made her skin crawl unreasonably.
She cleared her throat. "Um, thank you sir."
  The man turned to look at Brit.  He seemed like he was studying her for a moment, then said, "I'm Andrew Albert, and you are?"
  "Brittney"  She tried to walk around him to the door, but he fortified his position.
  "You staying long?"
  Brittney could feel panicky agitation creeping in, "No sir, excuse me."
  He looked at her again quizzically then moved out of the way.
  Brit stepped out.  The 'BEE--BOO" of the door sensor almost sounded like "get out".
  The rain was passing quickly, but now it was considerably colder outside.
  Brit walked.   She could not remember in which direction she had entered the store.
  Brit looked down.  When had she lost her shoes?
  She looked back up and continued.
  A pretty blue buick skylark pulled up to her near the edge of the town.  It honked and a towering older lady with her graying hair neatly atop her head spoke out to her. "Are you sure you won't stay? I have a perfectly empty room that you could borrow for a spell."
  Brit could feel her feet burning.  Had they been fine up until now? She thought she remembered the hurting but could not nail it down.  When did she remove her shoes?
  The woman had stepped out and opened the back seat door.  Brit smiled, thanked the woman and decided that maybe a good nap and she could head out once again when she woke.
   The car did a u-turn and headed back to the town and the old man's shop.  Magically a parking spot had opened up. Or it had been parked there and this woman had stole the car from it's inanimate slumber. Brit pictured this tall elegant woman pulling on a ski mask and holding a Slim Jim.
  Andrew stuck his head out the door again.  This time dodging and flinching from the water leaking above him.
  "Over here dear."  He pulled a large assortment of keys from his pocket and opened a tall thin door that looked squeezed between the two shops.
  It still had not occurred to Brit that the people were regarding her as if they knew her. She would have sluffed off that thought too, had it occurred to her.
  The woman led her up to the small immaculately clean apartment at the top of the narrow, long staircase.
  The woman pointed, "That's the bathroom."  Pointing another way, "that is the bedroom."   She nodded when she thought Brit acknowledged her.
  "I'll be down there, or Andrew will, let us know if you need anything."
  The woman had to duck when she exited into the stairwell.
  Brit walked over to the bed.  A plain set of baby blue sheets, and two layers of a knitted wool blanket.  One white, one less-white.
  Brit climbed in and closed her eyes. Briefly she worried about getting the whiter blanket dirty and decided to take it off the bed.  She whipped it to the side, onto the floor, and proceeded to sleep.
  She dreamed in the clicky channel surfing way.  Nothing ever sticking or making contact for long.
  She startled herself to wake with her own voice. "They didn't even notice I was gone."
  And when she looked out the window next to the bed it was dusk. Things were growing dark quickly.  A fire truck siren roared somewhere in the distance. Brit imagined a gas line somewhere below was leaking rapidly and would soon ignite sending her in tiny fleshy units against the ceiling, and the wall. Maybe some bits would escape when her femur struck the window by the bed.
  It was time to go.
  Quietly she padded to the door.  No lights had been turned on. Faint street lights spilled in the cracks around the door to the outside.
  She made it to the bottom step only stopping to once again imagine her body tumbling down the stairs, her head making an echoy 'conk' and her neck twisting and creeking on the way.
  It struck her that if she did not fully die from the fall that poor lady would find her there, and someone would realize she was gone.
  Brit shoved the thoughts aside and pushed out and on her way.
  A sudden and quick idea crossed through the rubble in her head, but it would not solidify and make itself known to her.  Maybe she couldn't remember things because she was constantly having to throw things away. Maybe the good stuff got caught with all the garbage and was dispensed without her knowledge....  That thought also scampered away as did all the others.
  Brit shivered when the warm air inside the apartment hall escaped out the door she had just opened.
  One foot after another, she made her way out of the community, away from it’s lights.
  Nothing seemed familiar. She thought maybe nothing ever did. Brit decided to go vertically instead of horizontally.  She crossed the street.
  Some had noticed she had left, but did not resent her for it, or think about her again for a long while.
  Brit made her way down the long dark road. It was country and it was creepy.  She should be scared, but was not.
  She walked.
  She forgot about the town of Bastille and walked.
  Miles of darkness to go.  Did they know she had left?
  As quickly as the thought appeared, it disappeared and she imagined a herd of deer, doe's, bucks and fawns alike startled by some predatory misstep.  They were sent stampeding toward her through the woods  and shoved their pointy cloven feet through her eye ball socket and into her squishy brain.


  Across the street was a sign.... "Welcome to Bastille"   Below that, "Leave all or leave nothing"  and in even smaller letters, "Mayor A. Albert : 2004".   She didn't remember a town,  but she was hungry, maybe she should turn around and look for some food.
A pair of worn blue and white tennis shoes lay at it’s base in patches of thriving wildflowers.








 




Thursday, May 8, 2014

thought I'd try a snowflake.

It all makes sense when i put pencil to paper, but then I try and put it into a program, and Epic Fail.


But this is what I got playing with Pygame.

It's just 1/12 of the snowflake.  Just gotta figure out how to rotate it, and mirror it.  Like 11 more times.  then add the prongs to the rest.

import pygame
from pygame.locals import*
import math
from sys import exit
from random import randint



def run():
    pygame.init()
    screen= pygame.display.set_mode((800, 800))
   
    R = 375  # radius
   
    # Rx = (1.15 * R)  = 431
   
    # Ry =( sqrt((375)**2 + (431)**2))
   
    # Ry = 196
   
   

        # center point (375, 375)  origin line (375, 0)
   
   
    clock = pygame.time.Clock()
   
   
    while True:
   
        for event in pygame.event.get():
            if event.type == QUIT:
                exit()
       
        change = randint(2, 175)
        n = 0.222222
        n2 = 0.5
        i = 0.111
        variance = 196
        x = (750)
        y = (750)
        x2 = (375)
        y2 = ( 0)   
        time_passed = clock.tick()
        time_passed_seconds = time_passed/1000

        screen.fill((0, 0, 0))

       
        Rainbow = (randint(0,255), randint(0, 255), randint(0,255))   
        O = randint(0, 375)
                    #   origin   (375, 375), (0, 750)
                    #  origin (375, 375), (750, 375)
        pygame.draw.line(screen, Rainbow, (375, 375), (x2, y2), 5)
        pygame.draw.line(screen, Rainbow, (x2, y* n * 2), (x2 - 270, x2 * n * 2), 6 )
        pygame.draw.line(screen, Rainbow, (x2, y * n ), ( x2 - 180, x2 *n), 5)   
        pygame.draw.line(screen, Rainbow, (x2, y * n * n2), ( x2 - 120, x2 * n * n), 4)
        pygame.draw.line(screen, Rainbow, (x2, y * n *n *n2), ( x2 - 30, x2 * n *n *n ), 3)    
        clock.tick(90)   
       

        pygame.display.update()

if __name__ == "__main__":
    run()

   

Wednesday, May 7, 2014

pygame move formula

It's not working right,  But its a start.


import pygame
from pygame.locals import*

from sys import exit
import math

class MoveObject(object):
    def __init__(self, x1, y1, n, i, w, h, imgw, imgh):
        self.x1 = 0.0
        self.y1 = 0.0
        self.n = n
        self.i = i
        self.w = w
        self.h = h
        self.imgw = imgw
        self.imgh = imgh
       
       

   

    @classmethod
    def object_formula(self, x1, y1, n, i, w, h, imgw, imgh):
        if n * w >1 and n * w < w and i * h > 1 and i * h < h:
           
            return MoveObject(x1 + n * imgw, y1 + i * imgh)
        else:
            return (0 ,0)

def main(MoveObject):
   
    pygame.init()
    screen = pygame.display.set_mode((800, 800), 0, 32)
    UniBrush = pygame.image.load("apoobrush.png")
    unibrush = pygame.transform.scale(UniBrush, (90, 90))
    while True:
        for event in pygame.event.get():
            if event.type == QUIT:
                exit()
       
       
        pressed_keys = pygame.key.get_pressed()
        if pressed_keys[K_LEFT]:
            n = -1.0
            n = n -1
        elif pressed_keys[K_RIGHT]:
            n = +1.0
            n = n + 1
        if pressed_keys[K_DOWN]:
            i = +1.0
            i = i + 1
        elif pressed_keys[K_UP]:
            i = -1.0
            i = i - 1
        else:
            n = 0
            i = 0
       
        (x, y) = MoveObject.object_formula(0, 0, n, i, 800, 800, 90, 90)
       
       
        screen.blit(unibrush, (x, y))
        pygame.display.flip()
       

main(MoveObject)
   
       
       
       
       
       

Monday, May 5, 2014

More on the rectangles.

If we take the Cartesian sum of a set  A and B,
Where A is the number of rects in the width
and B is the number of rects in the height...

(H * W)/ W =number of Width Rects (subtract one for A_max)
(H * W)/ H =number of Height Rects (subtract one for B_max)

Lets say it's a 4 x 5 rectangle.

So our two sets would be:
A = range(0, A_max)
B = range(0, B_max)
A = {(0, 1, 2, 3, 4)}
B = {(0, 1, 2, 3)}

the Cartesian set would be:
{(0,0), (0,1), (0,2), (0,3), (0, 4), (1, 0), (1, 1)....(4, 2), (4, 3)}

Each of these sets can represent the C and I in this formula,

(x + CW, y + IH)

Now how do I put it in a computer program, and how do I get it to save the results of each coordinates into a new list for the individual rects.... 

I want the program to be able to distinguish from the cartesian set and the formula, a set of individual rectangles.   That way all the rectangles in a map can be altered, or manipulated.

Kinda like a simple paint, but I don't want it to create them as we go.  I want them already gridded out, and then alterable from there. 

Lets say we can put an image in there like in photoshop, and alter it based on the individual rectanglular spots in the grid.

I don't know if this is how they do it already,  But just thinking that might be how the whole CGI stuff works.    Map a set of points, alter them as we see fit.

Except I just want a simple large-ish grid that can make simple sprites that are easily manipulated and moved, just like the Vector Class does in pygame,  but we can just click the squares and go.... I want these to move up by a vector of 2, 3,  these by 3, 4....  and so on until I've made my own animator without downloading a bunch of rediculously complicated software,  or maybe that's how it all already works and I just don't know it.

Either way, I want to create one myself...  cause I want to make simple sprites that move by with code,  not by image translation.
Are they the same thing?

Thursday, May 1, 2014

RECTANGLES

Been trying to figure out a formula that would allow me to make a loop which creates a screen filled with individual rectangles.


Here's what I come up with so far,  still have to write a program to fit it.

  x  axis,    width   of rectangles = w
  y axis,   hieght of rectangles = h
change in x = 1 =cx

 cx = cx + 1




   ---------------------------------------------------------------------------------------------------------------------------
  | (x, y)               |    (x +cx*w,  y)  |   ( x + cx*w, y)  |   (x + cx*w, y)   |   ( x + cx *w, y) |
  |______________ |________cx = 1__|______cx = 2_____|_______cx = 3____|______cx = 4____|
  |                                                                                                                                                       |
  | (x , y + h)  |   (x + cx*w, y +h) | (x + cx * w, y + h) |(x + cx*w, y + h) ......                  |
  |______________________________________________________________________________________|
  |                                                                                                                                                       |
  | (x, y + 2h)|  (x + cx*w, y + 2h) | ( x + cx *w, y + 2h)  ...........................................|
  |______________________________________________________________________________________|
  |                                                                                                                                                      |
  | (x, y + 3h) |  (x +cx*w, y + 3h) |( x + cx*w, y + 3h) .............................................|
  |______________________________________________________________________________________|

so for the rectangles within the rectangle.....  the origin, for pygame rect coordinates
would be (0, 0)  or (x, y),  
then every rect in the first column would be  (x, y + (i)*h)  where i would increase by one for each additional rect in the column.  
the next column would be (x +w, y+(i)*h)   and next (x + 2w,  y + (i)h)
and next (x + 3w, y +(i)*h)   the width would in crease by one multiple per column for x.

Or if we did rows,   the x would be the ( + (i)*w) and (y + h) only increasing once per row

Determined to get it to work.  Then have it make a list to keep track of each rectangle so it can be altered and changed. 
Maybe a "append.list[]"  for each rectangle created by the change in (i)



Tuesday, April 15, 2014

PsyGame

#the scores aren't working. 
#still trying to figure that out
#and then I'll try to make it into a class, instead of a function
 #need to add better instructions
#hold down your a,b,c  answer to see what the computer
#thinks of your answer.



import sys
import pygame
from pygame.locals import*
import math
from random import randint, choice
from math import*
from sys import exit

pygame.init()


              

one_results = {'a': 'so boringly normal.', 'b': 'At least you have an epi-pen. Right?',

                'c': 'Yea, I step on bees all the time.', 'd': 'Raid? Hell no, we got napalm.',

                'e': 'Sure, yell at it as it dies.', 'f': 'What makes you say that?',

                'g': 'Seriously? It is just a bee.'}

two_results = {'a': 'Kicking is fun. Alch-y.', 'b': 'Maybe if you yell explatives she will notice.',

                'c': 'Eh, you can get booze somewhere else.', 'd': 'throwing pine-sol at her might actually work.',

                'e': 'well maybe she can hear you, but the Captain Morgans is not going to fetch itself!',

                'f': 'but louder right?', 'g': 'That is illegal in 30 states.'}

three_results = {'a': 'again with the normal boring stuff!', 'b': 'At least you did not cry... did you?',

                'c': 'I aknowlege your suffering.', 'd': 'Fart in a can is the best for use in closed spaces. Kids love it.',

                'e': 'Did I mention the kids parent is extremely hot?', 'f': 'It was really good coffee after all.',

                'g': 'Uh-huh, and how long have you had these reactions?'}

four_results = {'a': 'It might work, but to what end?', 'b': 'It stuns them into silence. Good job!',

                'c': 'If they follow you, does the tree still fall in the woods?', 'd': 'Bleach... It might just burn thier throte enough...',

                'e': 'There is no try, only do!', 'f': 'Fine, I will kick them for you.', 'g': 'How are you going to get that into thier mouth?'}

five_results = {'a': 'normal is as normal does.', 'b': 'What because it might be something comming to get you?', 'c': 'My faucet leaks too.',

                'd': 'I love the smell of Lysol in the morning!', 'e': 'That does seem like a logical solution.',

                'f': 'Anything in particular, or the first thing that comes near?', 'g': 'Pretty sure you are not supposed to stick those in your ears.'}

six_results = {'a': 'Owww, oww owwy!', 'b': 'Sure, now you are a suspect.', 'c': 'Ninny ninny two by two, nothing left for you to do.',

                'd': 'Satan loves germs!', 'e': 'Oh, ok, but I really think you should explore this.', 'f': 'Are there three more churches near by?',

                'g': 'Hardly, the thing weighs 800 lbs!'}

seven_results = {'a': 'that seems inappropriate.', 'b': 'I think that is probably appropriate, next to wondering WTF.', 'c': 'LSD normal, or everyday normal?',

                'd': 'Might as well, reality is not working for you.', 'e': 'Louder then the growling Ninny-eater sitting over you?',

                'f': 'Yup, let me just write that down.', 'g': 'Cotton candy does sound delicious.'}

eight_results = {'a': 'Gas pedal or brake?', 'b': 'At least if you startle them, they might move.', 'c': 'or drive away...ninny',

                'd': 'Because they are sweaty gross bicyclist?', 'e': 'In a court of law, "I did not see them" will not fly.',

                'f': 'Honk, honk, honk.', 'g': 'So you are saying that you are not angry?'}

nine_results = {'a': 'Do not worry, I will not write that down...(writing quickly)', 'b': 'So more like panic, or dread?', 'c': 'Sure, it all makes sense now.',

                'd': 'Well as long they do not want you to drink it.', 'e': 'If it works, let me know.', 'f': 'Do the voices know what 51-50 means?',

                'g': 'That is very interesting. (run.... run now.)'}

ten_results = {'a': 'Make sure you wash your shoe afterward.', 'b': 'Bless you might have been better.', 'c': 'Good idea. Spread the plague to everyone.',

                'd': 'Splendid response.', 'e': 'You like that word?', 'f': 'Because blood is awesome.', 'g': 'It is for the good of all mankind.'}

eleven_results = {'a': 'Sure, kicking is always my first reaction.', 'b': 'Did I mention the individual is mute?',

                'c': 'Probably best. Ninny.', 'd': 'Especially if they touch you.',

                'e': 'It is ok not to answer.(ninny)', 'f': 'how about we just touch some lamposts and go watch monk?',

                'g': 'Is it legal for you to have that?'} #even responses.

twelve_results = {'a': 'eh, good thing I did not make it longer.', 'b': 'Results are gauranteed to be unprofessional, uneducated guesses. Ninny.',

                'c': 'Been on that couch a lot have you?', 'd': 'Please refrain from huffing until test is complete.', 'e': 'Ok, ok, I heard you.',

                'f': 'awww, it was not that bad.', 'g': 'I give, here are your results.'}  # odd responses.


   



even_choices = {'a': 'kick something/someone',
                'b': 'yell Shut the F--k up',
                'c': 'walk away',
                'd': 'always disinfect. Or run to nearest medical facility.',
                'e': 'no',
                'f': 'maybe if we do it 3 more times.',
                'g': 'other'}











H = 800
W = 800
screen = pygame.display.set_mode((H, W))
s_font = pygame.font.Font(None, 24)
font = pygame.font.Font(None, 32)
L_font = pygame.font.Font(None, 64)   
clock = pygame.time.Clock()
BLUE = (45, 0, 200)
GREEN = (0, 200, 45)
PURPLE = (200, 95, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 20)
WHITE = (240, 240, 255)   
WHITE1 = (200, 240, 255)



          
       
choicea = font.render("a = low anger", False, GREEN)
choiceb = font.render("b = anxiety", False, GREEN)
choicec = font.render("c = nothing,   this is normal", False, GREEN)
choiced = font.render("d = There is a can of gas that needs some using", False, GREEN)
choicee = font.render("e = Be louder,   that always works", False, GREEN)
choicef = font.render("f = just kill", False, GREEN)
choiceg = font.render("g = other", False, GREEN)

choicea2 = font.render("a = kick something/someone", False, GREEN)
choiceb2 = font.render("b = yell Shut the F--k up", False, GREEN)
choicec2 = font.render("c = walk away", False, GREEN)
choiced2 = font.render("d = always disinfect. Or run to nearest medical facility.", False, GREEN)
choicee2 = font.render("e =  'no'", False, GREEN)
choicef2 = font.render("f = maybe if we do it 3 more times.",False, GREEN)
choiceg2 = font.render("g = 'other'", False, GREEN)



def display_box():
    scorea = 0
    scoreb = 0
    scorec = 0
    scored = 0
    scoree = 0
    scoref = 0
    scoreg = 0
    scoreh = 0   
   
    pygame.draw.rect(screen, (200, 195, 100), (20, 20, 760, 760))
    pygame.draw.rect(screen, (BLUE), (30, 30, 740, 740), 10)
    intro = font.render("For instructions, press Space bar", False, BLUE)
    title1 = font.render("For entertainment only", False, GREEN)
    title2 = L_font.render("Personality", False, BLUE)
    title3 = L_font.render("Test", False, BLUE)
    title4 = s_font.render("illegitimate results will vary.",False, BLACK)
    author = font.render("Nellie Tobey, 2014", False, BLACK)
    clock.tick(30)
    instructionNext =font.render("to move on, push enter", False, BLUE)
       
    screen.blit(intro, (40, 40))
    screen.blit(title1, (60, 60))
    screen.blit(title2, (290, 300))
    screen.blit(title3, (340, 340))
    screen.blit(title4, (290, 380))
    screen.blit(author, (40, 640))
    pygame.display.flip()
   
   
   
   
           
    done = False   
   
    next = 0
    next_next = 0
    x = 1
    question_list = [" 1. You have stepped on a bee, and it died stinging you.",
                " 2. An elderly lady is blocking the way at the liquor store",
        " 3. A strangers child has knocked over your morning coffee.",
        " 4. Someone is trying to dramatically tell you a story.",
                " 5. A clicking noise is getting louder as you try to rest.",
                " 6. Someone has defiled a church and placed thier cross upside down.",
                " 7. You have awakened in a field of cotton candy neon blossoms.",
                " 8. The bicyclist in front of you refuses to get off the road even as you honk.",
                " 9. The voices say what?",
                " 10. A woman has sneezed and blood splatters on the floor in front of you.",
                " 11. A mysterious and dangerous looking individual is approaching you rapidly.",
                " 12. Are you tierd of questions?"]

   

    Results = font.render("Your scores. If you score higher then 20 any one catagorie..", False, BLACK)
    Results2 = font.render("... wow. And quit cheating my game!", False, BLACK)

    ResultsA = font.render( "Anger index = %r" % scorea, False, BLUE)

    ResultsB = font.render("Passive aggressive 'or just an angry asshole' index = %r" % scoreb, False, BLUE)

    ResultsC = font.render( "Normal, normal Ninny = %r" % scorec, False, BLUE)

    ResultsD = font.render( "Issues? Nothing prozac can't fix = %r" % scored, False, BLUE)

    ResultsE = font.render("Get your ears checked and/or Narcasism = %r" % scoree, False, BLUE)

    ResultsF = font.render( "OCD or Friggen nuts =  %r" % scoref, False, BLUE)

    ResultsG = font.render("Indecisive and/or Friggen Nuts = %r" % scoreg, False, BLUE)

    ResultsH = font.render( "Bat shit. = %r" % scoreh, False, BLUE)

   
    while done==False:
       
       
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                done = True
                exit()
       
        if next ==0:
            screen.blit(intro, (40, 40))
            screen.blit(title1, (60, 60))
            screen.blit(title2, (290, 300))
            screen.blit(title3, (340, 340))
            screen.blit(author, (40, 640))
            pygame.display.flip()
        keys = pygame.key.get_pressed()
        if (keys[K_SPACE]) and next == 0:
            next = +1
        if next == 1:           
            text = L_font.render("INSTRUCTIONS", False, (0, 35, 0))
            text_1 = font.render("push ENTER to begin your test!", False, (BLACK))

            pygame.draw.rect(screen, (200, 255, 255), (20, 20, 760, 760))
            screen.blit(text, (W/2 - 170, H/2 - 200))
            screen.blit(text_1, (W/2 - 100, H/2 - 150))

            pygame.display.flip()
            if (keys[K_RETURN]) and next ==1:
                next = 2
               
        elif next == 2:
            screen.fill(WHITE)
            pygame.draw.rect(screen, (BLUE), (30, 30, 740, 740), 10)
            question1 = font.render(question_list[0], False, RED)
            screen.blit(question1, (100, 50))
            screen.blit(choicea, (100, 120))
            screen.blit(choiceb, (100, 140))
            screen.blit(choicec, (100, 160))
            screen.blit(choiced, (100, 180))
            screen.blit(choicee, (100, 200))
            screen.blit(choicef, (100, 220))
            screen.blit(choiceg, (100, 240))
           
            instruction = font.render("choose your first response and press SPACE.", False, BLACK)
            screen.blit(instruction, (100, 300))
           
           
           
            pygame.display.flip()
           
       
            answer = ""
            if (keys[K_a]):
                answer = one_results['a']
                scorea = +1
            if (keys[K_b]):
                answer = one_results['b']
               
            if (keys[K_c]):
                answer = one_results['c']
               
            if (keys[K_d]):
                answer = one_results['d']
               
            if (keys[K_e]):
                answer = one_results['e']
               
            if (keys[K_f]):
                answer = one_results['f']
               
            if (keys[K_g]):
                answer = one_results['g']
               

            choices1 = font.render(answer, False, RED)
            screen.blit(choices1, (100, 390))
           
           
           
            if (keys[K_SPACE]) and (next ==2):
                next = 3
           
        elif next == 3:
            screen.fill(WHITE)
            pygame.draw.rect(screen, (BLACK), (30, 30, 740, 740), 10)
            question2 = font.render(question_list[1], False, RED)
            screen.blit(question2, (20, 50))
            screen.blit(choicea2, (100, 120))
            screen.blit(choiceb2, (100, 140))
            screen.blit(choicec2, (100, 160))
            screen.blit(choiced2, (100, 180))
            screen.blit(choicee2, (100, 200))
            screen.blit(choicef2, (100, 220))
            screen.blit(choiceg2, (100, 240))
            instruction = font.render("choose your first response and press ENTER.", False, BLACK)
            screen.blit(instruction, (100, 300))

       
            answer = ""
            if (keys[K_a]):
                answer = two_results['a']
               
            if (keys[K_b]):
                answer = two_results['b']
               
            if (keys[K_c]):
                answer = two_results['c']
               
            if (keys[K_d]):
                answer = two_results['d']
               
            if (keys[K_e]):
                answer = two_results['e']
               
            if (keys[K_f]):
                answer = two_results['f']
               
            if (keys[K_g]):
                answer = two_results['g']
               

            choices1 = font.render(answer, False, RED)
            screen.blit(choices1, (100, 390))
           
            pygame.display.flip()
            if (keys[K_RETURN]) and next ==3:
                next = 4
           
        elif next == 4:
            screen.fill(WHITE)
            pygame.draw.rect(screen, (BLUE), (30, 30, 740, 740), 10)
            question3 = font.render(question_list[2], False, RED)
            screen.blit(question3, (20, 50))
            screen.blit(choicea, (100, 120))
            screen.blit(choiceb, (100, 140))
            screen.blit(choicec, (100, 160))
            screen.blit(choiced, (100, 180))
            screen.blit(choicee, (100, 200))
            screen.blit(choicef, (100, 220))
            screen.blit(choiceg, (100, 240))
            instruction = font.render("choose your first response and press SPACE.", False, BLACK)
            screen.blit(instruction, (100, 300))

       
            answer = ""
            if (keys[K_a]):
                answer = three_results['a']
               
            if (keys[K_b]):
                answer = three_results['b']
               
            if (keys[K_c]):
                answer = three_results['c']
               
            if (keys[K_d]):
                answer = three_results['d']
               
            if (keys[K_e]):
                answer = three_results['e']
               
            if (keys[K_f]):
                answer = three_results['f']
               
            if (keys[K_g]):
                answer = three_results['g']
               

            choices1 = font.render(answer, False, RED)
            screen.blit(choices1, (100, 390))
           
            pygame.display.flip()
            if (keys[K_SPACE]) and next ==4:
                next = 5
       
       
        elif next == 5:
            screen.fill(WHITE)
            pygame.draw.rect(screen, (BLUE), (30, 30, 740, 740), 10)
            question4 = font.render(question_list[3], False, RED)
            screen.blit(question4, (20, 50))
            screen.blit(choicea2, (100, 120))
            screen.blit(choiceb2, (100, 140))
            screen.blit(choicec2, (100, 160))
            screen.blit(choiced2, (100, 180))
            screen.blit(choicee2, (100, 200))
            screen.blit(choicef2, (100, 220))
            screen.blit(choiceg2, (100, 240))
            instruction = font.render("choose your first response and press ENTER.", False, BLACK)
            screen.blit(instruction, (100, 300))
           
            answer = ""
           
            if (keys[K_a]):
                answer = four_results['a']
               
            if (keys[K_b]):
                answer = four_results['b']
               
            if (keys[K_c]):
                answer = four_results['c']
               
            if (keys[K_d]):
                answer = four_results['d']
               
            if (keys[K_e]):
                answer = four_results['e']
               
            if (keys[K_f]):
                answer = four_results['f']
               
            if (keys[K_g]):
                answer = four_results['g']
               

            choices1 = font.render(answer, False, RED)
            screen.blit(choices1, (100, 390))
            if (keys[K_RETURN]) and next ==5:
                next = 6
       
            pygame.display.flip()
       
        elif next == 6:
            screen.fill(WHITE1)
            pygame.draw.rect(screen, (BLUE), (30, 30, 740, 740), 10)
            question5 = font.render(question_list[4], False, RED)
            screen.blit(question5, (20, 50))
            screen.blit(choicea, (100, 120))
            screen.blit(choiceb, (100, 140))
            screen.blit(choicec, (100, 160))
            screen.blit(choiced, (100, 180))
            screen.blit(choicee, (100, 200))
            screen.blit(choicef, (100, 220))
            screen.blit(choiceg, (100, 240))
            instruction = font.render("choose your first response and press SPACE.", False, BLACK)
            screen.blit(instruction, (100, 300))

       
            answer = ""
            if (keys[K_a]):
                answer = five_results['a']
               
            if (keys[K_b]):
                answer = five_results['b']
               
            if (keys[K_c]):
                answer = five_results['c']
               
            if (keys[K_d]):
                answer = five_results['d']
               
            if (keys[K_e]):
                answer = five_results['e']
               
            if (keys[K_f]):
                answer = five_results['f']
               
            if (keys[K_g]):
                answer = five_results['g']
               

            choices1 = font.render(answer, False, RED)
            screen.blit(choices1, (100, 390))
            if (keys[K_SPACE]) and next ==6:
                next = 7
            pygame.display.flip()

       
       
        elif next == 7:
            screen.fill(WHITE1)
            pygame.draw.rect(screen, (BLUE), (30, 30, 740, 740), 10)
            question6 = font.render(question_list[5], False, RED)
            screen.blit(question6, (20, 50))
            screen.blit(choicea2, (100, 120))
            screen.blit(choiceb2, (100, 140))
            screen.blit(choicec2, (100, 160))
            screen.blit(choiced2, (100, 180))
            screen.blit(choicee2, (100, 200))
            screen.blit(choicef2, (100, 220))
            screen.blit(choiceg2, (100, 240))
            instruction = font.render("choose your first response and press ENTER.", False, BLACK)
            screen.blit(instruction, (100, 300))

       
            answer = ""
            if (keys[K_a]):
                answer = six_results['a']
               
            if (keys[K_b]):
                answer = six_results['b']
               
            if (keys[K_c]):
                answer = six_results['c']
               
            if (keys[K_d]):
                answer =six_results['d']
               
            if (keys[K_e]):
                answer = six_results['e']
               
            if (keys[K_f]):
                answer = six_results['f']
               
            if (keys[K_g]):
                answer = six_results['g']
               

            choices1 = font.render(answer, False, RED)
            screen.blit(choices1, (100, 390))
            if (keys[K_RETURN]) and next ==7:
                next = 8
            pygame.display.flip()

           
           
       
        elif next == 8:
           
            screen.fill(WHITE1)
            pygame.draw.rect(screen, (BLUE), (30, 30, 740, 740), 10)
            color = font.render("Did the screen change color?", False, GREEN)
            screen.blit(color, ( 135, 200 ))
            colorblind = font.render("y for yes, n for no", False, GREEN)
            screen.blit(colorblind, (135, 240))
            instruction = font.render("choose your first response and press SPACE.", False, BLACK)
            screen.blit(instruction, (100, 300))
           

            answer = ""
            if (keys[K_y]):
                answer = "you can answer something honestly!"
                choices1 = font.render(answer, False, RED)
                screen.blit(choices1, (100, 390))
            if (keys[K_n]):
                answer = "This is no fun if you aren't paying attention."
                choices2 = font.render(answer, False, RED)
                screen.blit(choices2, (100, 390))
           
           

                scorea = +10
                scoreb = +10
                scorec = +1
                scored = +5
                scoree = +10
                scoref = +2
                scoreg = +5
                scoreh = +1

             
           
            if (keys[K_SPACE]) and next ==8:
                next = 9
           
            pygame.display.flip()

       
        elif next == 9:
       


            screen.fill(WHITE1)
            pygame.draw.rect(screen, (BLUE), (30, 30, 740, 740), 10)

            screen.blit(Results, (100, 180))
            screen.blit(Results2, (100, 210))
            screen.blit(ResultsA, (120, 230))
            screen.blit(ResultsB, (120, 250))
            screen.blit(ResultsC, (120, 270))
            screen.blit(ResultsD, (120, 290))
            screen.blit(ResultsE, (120, 310))
            screen.blit(ResultsF, (120, 330))
            screen.blit(ResultsG, (120, 350))
            screen.blit(ResultsH, (120, 370))
            pygame.display.flip()


display_box()