Sonic322 Posted July 22, 2010 Share Posted July 22, 2010 hits LZ up-side the head takes cookie Link to comment Share on other sites More sharing options...
Aki Dazrold Posted July 24, 2010 Share Posted July 24, 2010 Ok, really. You aren't supposed to use force to take the dangéd cookie. I overlooked it a lot recently but now it seems like all you do now is smack somebody and steal it. This kinda kills the game. And I beleive that long-winded explanation was a sufficient distraction in itself, so... *Yoink* Link to comment Share on other sites More sharing options...
admalledd Posted July 24, 2010 Share Posted July 24, 2010 is it okay to re-use an old distraction technique? import pygame from pygame.locals import * import math from input import button,drag_button def dist(rect_a,rect_b): '''rect_a == top block to snap to rect_b == bottom block to check''' return math.sqrt(((rect_a.midbottom[0]-rect_b.midtop[0])**2)+((rect_a.midbottom[1]-rect_b.midtop[1])**2)) class menu(object): def __init__(self): self.font = pygame.font.Font(None,48) self.clickable =[ (button((300,160) ,self.font.render('start game',True,(0,0,255)).convert_alpha() ,self.font.render('start game',True,(255,0,00)).convert_alpha() ,self.font.render('start game',True,(0,255,0)).convert_alpha() ) ,self.start ), (button((300,240) ,self.font.render('credits',True,(0,0,255)).convert_alpha() ,self.font.render('credits',True,(255,0,0)).convert_alpha() ,self.font.render('credits',True,(0,255,0)).convert_alpha() ) ,self.credits ) ] self.dragable = [(drag_button((300,300) ,self.font.render('drag me',True,(0,0,255)).convert_alpha() ,self.font.render('drag me',True,(255,0,0)).convert_alpha() ,self.font.render('drag me',True,(0,255,0)).convert_alpha() ) ) ] self.receptical = [] self.hub_img = self.font.render('mount me',True,(0,0,255)).convert_alpha() self.hub_rect = self.hub_img.get_rect() self.hub_rect.topleft = (500,200) self.surf = pygame.Surface((800, 600)) def add_click_btn(self, btn, func): self.clickable.append(btn) def add_drag_btn(self, btn): self.dragable.append(btn) def add_receptical_btn(self,btn): self.receptical.append(btn) def events(self,events): for btn,func in self.clickable: var = btn.events(events) if var: func(btn) for btn in self.dragable: if btn.events(events): self.dragged(btn) for event in events: if event.type == MOUSEBUTTONUP and event.button == 1: print event.pos def draw(self,screen): for btn,func in self.clickable: btn.draw(screen) for btn in self.dragable: btn.draw(screen) screen.blit(self.hub_img,self.hub_rect) pygame.draw.rect(screen, (255,255,255), self.hub_rect, 1) def start(self,btn): print 'start clicked' def credits(self,btn): print 'credits clicked' def dragged(self,btn): print 'button dragged' d = dist(self.hub_rect,btn.rect)#find distance between midtop and midbottom print d if d < 15: btn.rect.midtop=self.hub_rect.midbottom if __name__=='__main__': pygame.init() screen = pygame.display.set_mode((800, 600)) me = menu() while True: pygame.time.wait(10) screen.fill((0, 0, 0)) events = pygame.event.get() for event in events: if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE): pygame.quit() import sys sys.exit() me.events(events) me.draw(screen) pygame.display.flip() *MINE* Link to comment Share on other sites More sharing options...
Zephyria Posted July 24, 2010 Share Posted July 24, 2010 Coding Doesn't Distract Me...Unless It's LUA *Insert Copypasta Here* *Liberate* Link to comment Share on other sites More sharing options...
RockmoddeR Posted July 24, 2010 Share Posted July 24, 2010 Hey look, about 300+ spring widgets all written in LUA! *ninja'd* Link to comment Share on other sites More sharing options...
Sonic322 Posted July 24, 2010 Share Posted July 24, 2010 chucks a potato at RockmoddeR mine Link to comment Share on other sites More sharing options...
Shadow322 Posted July 24, 2010 Share Posted July 24, 2010 *shows pic of Rouge in swimsuit* *take cookie* Link to comment Share on other sites More sharing options...
Sonic322 Posted July 24, 2010 Share Posted July 24, 2010 throws a chaos emerald into a car that is driving away so shadow will chase the car takes cookie Link to comment Share on other sites More sharing options...
Zjean Posted July 25, 2010 Share Posted July 25, 2010 Beware of language. *Yoink.* Link to comment Share on other sites More sharing options...
Shadow322 Posted July 25, 2010 Share Posted July 25, 2010 *punches Sonic for breaking the rule saying you can't controll other players* *hits Zjean over the head with a shoe* *takes cookie* Link to comment Share on other sites More sharing options...
Zephyria Posted July 25, 2010 Share Posted July 25, 2010 *punches Sonic for breaking the rule saying you can't controll other players* *hits Zjean over the head with a shoe* *takes cookie* You Just DON'T FUGGING GET IT, DO YOU? The Rules State The Cookie Is To Be Taken Through NON-VIOLENT MEANS! GET IT? Link to comment Share on other sites More sharing options...
Shadow322 Posted July 25, 2010 Share Posted July 25, 2010 *punches Zeph* Give me that fragen cookie! Link to comment Share on other sites More sharing options...
Aki Dazrold Posted July 25, 2010 Share Posted July 25, 2010 *drops a steamroller on Shadow, but leaves the cookie there for the taking* Link to comment Share on other sites More sharing options...
Zjean Posted July 25, 2010 Share Posted July 25, 2010 Erm, you can't use force... you must distract the person. Anyway, Look an even bigger cookie over by the fountain! *grabs cookie out of your hand and runs* As LZ said not but a few posts ago... And Zephyr just said... Oh and hey, a cookie. Link to comment Share on other sites More sharing options...
Shadow322 Posted July 25, 2010 Share Posted July 25, 2010 *Gives F- homework to Zjean* You don't deserve a cookie. Link to comment Share on other sites More sharing options...
Zjean Posted July 25, 2010 Share Posted July 25, 2010 *Absently gives homework to Dennis while counting the number of chocolate chips in the cookie.* Link to comment Share on other sites More sharing options...
Aki Dazrold Posted July 25, 2010 Share Posted July 25, 2010 *fires Dennis out of a cannon* Oh hey where did this cookie come from? *take* Link to comment Share on other sites More sharing options...
Shadow322 Posted July 25, 2010 Share Posted July 25, 2010 Hey LZ, I got a new cookie make out of tabasco, how about a trade? *swipes cookie* Link to comment Share on other sites More sharing options...
Aki Dazrold Posted July 25, 2010 Share Posted July 25, 2010 I devour that Tabasco-cookie! And I do it in a very flashy manner! Whilst you behold this spectacle, a shadow clone of me swipes the real cookie back. Link to comment Share on other sites More sharing options...
Sonic322 Posted July 25, 2010 Share Posted July 25, 2010 runs around LZ really fast so he gets dizzy takes cookie Link to comment Share on other sites More sharing options...
Shadow322 Posted July 25, 2010 Share Posted July 25, 2010 *confuses Sonic by saying, "Sayonara, Sonic the hedgehog"* *takes cookie back* Link to comment Share on other sites More sharing options...
Sonic322 Posted July 25, 2010 Share Posted July 25, 2010 tells Shadow that LZ is holding Maria captured takes cookie Link to comment Share on other sites More sharing options...
Shadow322 Posted July 25, 2010 Share Posted July 25, 2010 *lets Amy loose on Sonic* *takes cookie* Link to comment Share on other sites More sharing options...
Sonic322 Posted July 25, 2010 Share Posted July 25, 2010 locks shadow in a box takes cookie Link to comment Share on other sites More sharing options...
Shadow322 Posted July 26, 2010 Share Posted July 26, 2010 *make invisibily potion* Hey Sonic, I'll trade this for the cookie! *takes cookie* Link to comment Share on other sites More sharing options...
Recommended Posts