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.
Friday, August 29, 2014
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()
#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()
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()
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)
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?
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?
Subscribe to:
Posts (Atom)
