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

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


  Mostrar Mensajes
Páginas: 1 ... 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 [200] 201 202 203 204 205 206 207 208 209 210 211 212
1991  Foros Generales / Noticias / Re: Piden el cierre de un buscador web de prostitutas en: 12 Mayo 2010, 16:36 pm
como mola esa web . la tengo que usar antes que la cierren G_G.

mira que son pesadas.

con "atenta contra la dignidad de las mujeres y desde luego contra el principio de igualdad ". eso es mentira, como mucho atenta a ellas misma no a otras  mujeres.

que pais de libertad es este que ya no dejan que cada uno haga lo que quiera consigo mismo. 

Capa que si un suicida se suicida le embargan todo a los familiares.

1992  Foros Generales / Noticias / Re: Desarrolladores independientes, desilusionados ante los piratas en: 12 Mayo 2010, 00:53 am
yo no puedo donar, donde descargo esto? quiero ver el codigo para aprender.
1993  Programación / Programación C/C++ / Re: [DUDA] clases es bueno esto? en: 11 Mayo 2010, 18:56 pm
no , era para esto.
main.cpp
Código
  1. #include <iostream>
  2. #include <SDL/SDL.h>
  3. #include <SDL/SDL_image.h>
  4. #include "entidad.h"
  5. using namespace std;
  6. SDL_Surface *screen;
  7. SDL_Event evento;
  8. Uint8 *tecla;
  9. float tiempo;
  10. int framerate;
  11.  
  12. Centidad Epj;
  13. Centidad Enpc[100];
  14. Centidad Esuelo[100];
  15. int main(int argc,char *argv[]){
  16.    SDL_Init(SDL_INIT_VIDEO);
  17.    screen=SDL_SetVideoMode(640,480,32,SDL_SWSURFACE);
  18.    SDL_WM_SetCaption("App1",0);
  19.    //dando valores
  20.    Enpc[1].crear_entidad(TPJ);
  21.    Esuelo[0].setx(0);Esuelo[0].setw(640);Esuelo[0].sety(430);Esuelo[0].seth(20);
  22.    //suelo.crear_entidad(TCOLISION);
  23.    Epj.setx(320);
  24.    Epj.sety(50);
  25.    Epj.aloadimagen("ryu-01.png",6);
  26.    Epj.cani(0,0,0);
  27.    Epj.cani(1,1,4);
  28.    Enpc[1].setx(300);
  29.    Enpc[1].sety(360);
  30.    Enpc[1].loadimagen("ken-01.png",0);
  31.    while(1){
  32.        //iniciamos el reloj
  33.        tiempo=SDL_GetTicks();
  34.        framerate++;
  35.        //**************************************
  36.        SDL_FillRect(screen,0,SDL_MapRGB(screen->format,0,0,0));
  37.        tecla=SDL_GetKeyState(0);
  38.        SDL_PollEvent(&evento);
  39.        if(tecla[SDLK_ESCAPE])exit(1);
  40.        if(tecla[SDLK_a])pul=1;
  41.        if(framerate%6==0)Enpc[0].ani(pul);
  42.  
  43.        Epj.gravedad(&Esuelo[0]);
  44.        Epj.gravedad(&Enpc[0]);
  45.        Epj.caida();
  46.  
  47.        //actualizaciones visuales
  48.        Epj.drawimagen(screen,pul);
  49.        Enpc[1].drawimagen(screen,0);
  50.        SDL_Flip(screen);
  51.        //comprovamos el tiempo
  52.        tiempo =SDL_GetTicks()-tiempo;
  53.        if(tiempo < 33.33){            //si aun sobra tiempo hasta llegar a los 33.33 ms
  54.            SDL_Delay( 33.33-tiempo ); //vete a dormir durante 33.33-x milisegundos 33.33 ms es = 30 fps en 1 s
  55.        }
  56.        if(framerate==30)framerate=0;
  57.    }
  58.  
  59.  
  60. }
  61.  
remlet.h
Código
  1. int remlet(char buscar,char* entrada, char* salida,int num){
  2.    char conv[2];
  3.    for(int i=0;i<strlen(entrada);i++){
  4.        if(entrada[i]==buscar){
  5.            strcpy(salida,entrada);
  6.            itoa(num,conv,10);
  7.            if(num<10){
  8.                salida[i+1]='0';
  9.                salida[i+2]=conv[0];
  10.            }
  11.            else {
  12.                salida[i+1]= conv[0];
  13.                salida[i+2]= conv[1];
  14.            }
  15.            return 1;
  16.        }
  17.    }
  18.    return 0;
  19. }
  20.  
entidad.h
Código
  1. #include "remlet.h"
  2. //TIPOS
  3. #define TPJ 1
  4. #define TMOB 2
  5. #define TOBJETO 3
  6. #define TCOLISION 4
  7. //ESTADO
  8. #define _EQUIETO 1
  9. #define _EAIRE 2
  10. #define _ESALTO 3
  11. #define _ECAER 4
  12. /**********************************************
  13. clase para cargar 1 imagen y posicionarla en 1 posicion
  14. */
  15. int pul=0;
  16. class Centidad{
  17.    public:
  18.        Centidad();
  19.        struct STani{
  20.            int fmax;
  21.            int fn;
  22.            int tmp;
  23.        } stani[100];
  24.        SDL_Surface *plantilla[100];
  25.        SDL_Surface *imagen;
  26.        SDL_Rect pos;
  27.        int tipo;
  28.        int estado;
  29.        int posx;
  30.        int posy;
  31.        int posw;
  32.        int posh;
  33.        int tmp1;
  34.        int sani1;
  35.        int sani2;
  36.        int crear_entidad(int t);
  37.        int loadimagen(char* file,int f);
  38.        int aloadimagen(char* file,int fmax);
  39.        int drawimagen(SDL_Surface *scr, int v);
  40.        int getx();
  41.        int gety();
  42.        int getw();
  43.        int geth();
  44.        void setx(int x);
  45.        void sety(int y);
  46.        void setw(int w);
  47.        void seth(int h);
  48.        void ani(int v);
  49.        void cani(int v,int fn,int fmax);
  50.        int choca(Centidad *ent);
  51.        int gravedad(Centidad *ent);
  52.        int saltar();
  53.        void Centidad::caida();
  54.  
  55. };
  56. Centidad::Centidad(){
  57.    estado=1;
  58.    tmp1=0;
  59. }
  60. int Centidad::crear_entidad(int e){
  61.    tipo=e;
  62. }
  63. int Centidad::loadimagen(char *file, int f){
  64.    plantilla[f]=IMG_Load(file);
  65.    if(plantilla[f]!=0)return 1;
  66.    else return 0;
  67. }
  68. int Centidad::aloadimagen(char *file, int fmax){
  69.    char salida[strlen(file)];
  70.    for(int i=0;i<fmax;i++){
  71.        remlet('-',file,salida,i+1);
  72.        plantilla[i]=IMG_Load(salida);
  73.    }
  74. }
  75. int Centidad::drawimagen(SDL_Surface *scr,int v){
  76.    imagen=plantilla[stani[v].tmp];
  77.    SDL_BlitSurface(imagen,0,scr,&pos);
  78. }
  79. int Centidad::getx(){
  80.    return posx;
  81. }
  82. int Centidad::gety(){
  83.    return posy;
  84. }
  85. int Centidad::getw(){
  86.    if(imagen!=0)return imagen->w;
  87.    else return posw;
  88. }
  89. int Centidad::geth(){
  90.    if(imagen!=0)return imagen->h;
  91.    else posh;
  92. }
  93. void Centidad::setx(int x){
  94.    pos.x=posx=x;
  95. }
  96. void Centidad::sety(int y){
  97.    pos.y=posy=y;
  98. }
  99. void Centidad::setw(int w){
  100.    pos.w=posw=w;
  101. }
  102. void Centidad::seth(int h){
  103.    pos.h=posh=h;
  104. }
  105. void Centidad::ani(int v){
  106.    sani1=v;
  107.    if(sani1!=sani2){
  108.        stani[v].tmp=stani[v].fn;
  109.        sani2=sani1;
  110.    }
  111.    if(stani[v].tmp <stani[v].fn+stani[v].fmax){
  112.        stani[v].tmp++;
  113.    }
  114.    else { stani[v].tmp=stani[v].fn;pul=0;}
  115. }
  116. void Centidad::cani(int v,int fn,int fmax){
  117.    stani[v].fn=fn;
  118.    stani[v].fmax=fmax;
  119. }
  120. int Centidad::choca(Centidad *ent){
  121.    int x1=getx();
  122.    int y1=gety();
  123.    int w1=getw();
  124.    int h1=geth();
  125.    int x2=ent[0].getx();
  126.    int y2=ent[0].gety();
  127.    int w2=ent[0].getw();
  128.    int h2=ent[0].geth();
  129.    for(int i=0;i<100;i++){
  130.        x2=ent[i].getx();
  131.        y2=ent[i].gety();
  132.        w2=ent[i].getw();
  133.        h2=ent[i].geth();
  134.        if(  (((x1+w1) > x2) && (x1<(x2+w2))) &&  (((y1+h1) > y2) && (y1 < (y2+h2))) ){
  135.            //hay colision
  136.            return 1;
  137.        }
  138.    }
  139.    return 0;
  140. }
  141. int Centidad::gravedad(Centidad *ent){
  142.    int ctmp=choca(ent);
  143.    if(ctmp==1){
  144.        estado=_EQUIETO;
  145.        return 1;
  146.    }
  147.    else {
  148.        estado=_ECAER;
  149.        return 0;
  150.    }
  151. }
  152.  
  153. void Centidad::caida(){
  154.  
  155.    int y=gety();
  156.    if(estado==4)sety(y+6);
  157. }
  158. int Centidad::saltar(){
  159.    if(estado == _EQUIETO){
  160.  
  161.    }
  162. }
  163.  
1994  Programación / Programación C/C++ / Re: [DUDA] clases es bueno esto? en: 11 Mayo 2010, 18:22 pm
no si ahcerlo lo hecho pero queria saber si no era cosa rara y podia pasar cosas raras.

saludos.
1995  Programación / Programación C/C++ / [DUDA] clases es bueno esto? en: 11 Mayo 2010, 16:37 pm
hola quisiera saber si este metodo de empleo para clases es bueno o malo

Código
  1. class a{
  2. }
  3. a a1[100];

esque necesito hacer 1 clase por ejemplo enemigos y mediante 1 bucle comprobar variables de la clase.

SALUDOS
1996  Foros Generales / Foro Libre / Re: Que le preguntarías a un extraterrestre? en: 11 Mayo 2010, 00:17 am
sabeis manejar nanobots?
como son los juegos en tu planeta?
usais altavoces?
teneis moviles?
...
cuentame 1 resumen de la historia de tu planeta.
1997  Foros Generales / Foro Libre / Re: Novedades en el sexo actual en: 10 Mayo 2010, 18:39 pm
yo soy adicto . lo dicho por aburrimiento.
1998  Foros Generales / Foro Libre / Re: Novedades en el sexo actual en: 10 Mayo 2010, 15:48 pm
CUIDADO¡¡ el sexo es muy adictivo.

Criticas:
Buenas:
te sientes bien.
eres feliz.
muchisimas cosas mas.
Malo:
Puede matar "enfermedades".
puede matar , si te acuestas con algun@ con pareja.
puede matar, muchisimas cosas mas.+

SALUDOs.
1999  Foros Generales / Noticias / Re: Una molécula de yodo puede calcular miles de veces más rápido que un PC en: 10 Mayo 2010, 12:47 pm
interesante, muy interesante
2000  Foros Generales / Foro Libre / Re: Cómo viajar en el tiempo, según Stephen Hawking en: 10 Mayo 2010, 11:34 am
Baneen a este tio.


otra cosa a decir si viajamos al futuro no podemos volver al pasado ¡¡¡. segun las leyes del tiempo.
Páginas: 1 ... 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 [200] 201 202 203 204 205 206 207 208 209 210 211 212
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines