viernes, 5 de enero de 2024

Juego pruebas

import pygame pygame.init() screen = pygame.display.set_mode((400, 400)) squareX = 50 squareY = 50 circleX = 50 circleY = 50 while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() quit() if event.type == pygame.MOUSEBUTTONDOWN: if squareX < mouse[0] < squareX + 50 and squareY < mouse[1] < squareY + 50: circleX = squareX + 25 circleY = squareY + 25 screen.fill((255, 255, 255)) pygame.draw.rect(screen, (0, 0, 0), (squareX, squareY, 50, 50)) pygame.draw.circle(screen, (0, 0, 0), (circleX, circleY), 25) circleY -= 1 pygame.display.update() let squareX = 50; let squareY = 50; let circleX = 50; let circleY = 50; function setup() { createCanvas(400, 400); } function draw() { background(220); rect(squareX, squareY, 50, 50); circle(circleX, circleY, 25); circleY -= 1; } function mousePressed() { if (mouseX > squareX && mouseX < squareX + 50 && mouseY > squareY && mouseY < squareY + 50) { circleX = squareX + 25; circleY = squareY + 25; } }let squareX = 50;
let squareY = 50;
let circleX = 50;
let circleY = 50;

function setup() {
  createCanvas(400, 400);
}

function draw() {
  background(220);
  rect(squareX, squareY, 50, 50);
  circle(circleX, circleY, 25);
  circleY -= 1;
}

function mousePressed() {
  if (mouseX > squareX && mouseX < squareX + 50 && mouseY > squareY && mouseY < squareY + 50) {
    circleX = squareX + 25;
    circleY = squareY + 25;
  }
}

Lanzando toca pantalla

 <!DOCTYPE html>

<html>

<head>

<style>

  .cube {

    position: absolute;

    width: 50px;

    height: 50px;

    background-color: red;

    animation: move 2s linear infinite;

  }


  @keyframes move {

    from {

      transform: translate(0, 0);

    }

    to {

      transform: translate(0, 100vh);

    }

  }

</style>

</head>

<body>

  <script>

    document.addEventListener('touchstart', function(e) {

      var cube = document.createElement('div');

      cube.classList.add('cube');

      cube.style.left = e.touches[0].clientX + 'px';

      cube.style.top = e.touches[0].clientY + 'px';

      document.body.appendChild(cube);

    });

  </script>

</body>

</html>


Circulo girando

 <!DOCTYPE html>

<html>

<head>

<style>

  .ball {

    position: absolute;

    width: 10px;

    height: 150px;

    margin: 50px auto 0;

    border-radius: 50%;

    background: radial-gradient(circle at 65% 15%, white 1px, aqua 3%, darkblue 60%, aqua 100%);

    animation: rotate 2s linear infinite;

  }


  @keyframes rotate {

    from {

      transform: rotate(0deg);

    }

    to {

      transform: rotate(360deg);

    }

  }

</style>

</head>

<body>

  <div class="ball"></div>

</body>

</html>


jueves, 4 de enero de 2024

Pruebas html 2

Toca con el dedo

Prueba

En esta prueba muebo un cubo con un script para html....en la prueba de mas arriba al tocar el cuadrado aparecen cuadraritos al tocar pantalla de telefono movil en pc no funciona......todo echo con IA.........manipulable ....con la IA...tienes un maestro de escuela.....simplemente alucinante

Triangulo programado por html

Ayudado por IA consegui hacer un cuadrado y un triangulo simples girando ......pronto are algun juego asi tambien ayudado por la IA estoy alucinando pepinillos
.



...........



<!DOCTYPE html>
<html>
<head>
  <title>Triángulo azul girando continuamente</title>
  <style>
    .triangle {
      width: 0;
      height: 0;
      border-left: 50px solid transparent;
      border-right: 50px solid transparent;
      border-bottom: 100px solid blue;
      position: relative;
      animation: rotate 2s infinite linear;
    }
    @keyframes rotate {
      from {
        transform: rotate(0deg);
      }
      to {
        transform: rotate(-360deg);
      }
    }
  </style>
</head>
<body>
  <div class="triangle"></div>
</body>
</html>

Triángulo azul girando continuamente

Cuadrado gira por html programacion simple

<!DOCTYPE html>
<html>
<head>
  <title>Cuadrado girando continuamente</title>
  <style>
    .square {
      width: 100px;
      height: 100px;
      background-color: red;
      position: relative;
      animation: rotate 2s infinite linear;
    }
    @keyframes rotate {
      from {
        transform: rotate(0deg);
      }
      to {
        transform: rotate(360deg);
      }
    }
  </style>
</head>
<body>
  <div class="square"></div>
</body>
</html>

Cuadrado girando continuamente