Entradas

How to Make The Pong Game

Imagen
Code of Pong.pde : PVector player, enemy, ball; float ballSpeedX, ballSpeedY, enemySpeed; int playerScore = 0; int enemyScore = 0; float ballSize; void setup() {     size(480, 320, OPENGL);             ball = new PVector(width/2, height/2);     player = new PVector(width, height/2);     enemy = new PVector(0, height/2);         ballSpeedX = width/100;     ballSpeedY = width/100;             enemySpeed = width/150;         ballSize = width/20;         rectMode(CENTER);       } void draw() {     background(26);         centerLine();     drawBall();     drawPlayer();     drawEnemy();  ...

How to animate a text in HTML

Imagen
Code of index.html : <!DOCTYPE html> <html lang="es"> <head>     <title>Index</title>     <meta charset="utf-8">     <link rel="stylesheet" href="style.css"> </head> <body>     <div class="container">         <span class="text1">welcome In</span>         <span class="text2">Code Creator</span>     </div> </body> </html> Code of style.css : *{     padding: 0;     margin: 0;     font-family: sans-serif; } body{     background-color: white; } .container{     text-align: center;     position: absolute;     top: 50%;     left: 50%;     transform: translate(-50%,-50%);    ...

The Snake Game

Imagen
Code of snake.pde : class Snake {   ArrayList<PVector> body;   float xdir, ydir, len;   Snake() {     this.body = new ArrayList<PVector>();     this.body.add(new PVector(floor(w / 2), floor(h / 2)));     this.xdir = 0;     this.ydir = 0;     this.len = 0;   }   void setDir(float x, float y) {     this.xdir = x;     this.ydir = y;   }   void update() {     PVector head = this.body.get(this.body.size() -1).copy();     this.body.remove(0);     head.x += this.xdir;     head.y +=this.ydir;     this.body.add(head);   }   void grow() {     PVector head = this.body.get(this.body.size() -1).copy();     this.len++;     this.body.add(head);   }   boolean endGame() {     float x = this.body....

How to Count Characters in Textarea using JavaScript

Imagen
Code of index.html : <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Text Counter</title> <!--Link compiled and minified CSS--> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <style> .container { width: 500px; margin-top: 100px; font-size: 18px; } </style> </head> <body> <div class="container"> <form> <div class="form-group"> <label>Count Up</label> <textarea class="form-control" rows="5" onkeyup="count_up(this);" maxlength="70"></textarea> <span class="text-muted pull-right" id="count1">0</span> ...

How to make a Snowflake in Processing

Imagen
Code of particle.pde : class Particle {   PVector pos;   float r;   Particle(float radius, float angle) {     pos = PVector.fromAngle(angle);     pos.mult(radius);     r = 3;   }   void update() {     pos.x -= 1;     pos.y += random(-3, 3);     float angle = pos.heading();     angle = constrain(angle, 0, PI/6);     float magnitude = pos.mag();     pos = PVector.fromAngle(angle);     pos.setMag(magnitude);   }   void show() {     fill(255);     stroke(255);     ellipse(pos.x, pos.y, r * 2, r *2);   }   boolean intersects(ArrayList<Particle> snowflake) {     boolean result = false;     for (Particle s : snowflake) {       float d = dist(s.pos.x, s.pos.y, pos.x, pos.y);    ...

Chat with Firebase

Imagen
Code of index.html : <!DOCTYPE HTML> <html>    <head> <!-- Scripts jQuery, bootstrap --> <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>               <!-- Estilos  bootstrap, chat--> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link rel="stylesheet" href="css.css" >       <!-- área de código Firebase y lectura de Mensajes-->        <script src="https://www.gstatic.com/firebasejs/5.6.0/firebase.js"></script>   <script>      // Init...

How to Create RGB to HEX Converter with JavaScript

Imagen
Code of index.html : <!DOCTYPE html> <html lang="es"> <head>     <meta charset="utf-8">     <title>RGB to HEX Converter</title>     <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inconsolata">     <style>         #container{             font-family: 'Inconsolata', monospace;             text-align: center;             width: 800px;             margin: 160px auto;         }         table{             width: 100%;         }         h1{      ...

How to make eyes that follow the mouse in HTML

Imagen
Code of index.html : <!DOCTYPE html> <html lang="en" dir="ltr">   <head>     <meta charset="utf-8">     <link rel="stylesheet" href="style.css">     <title></title>   </head>   <body>   <div class="eyes">     <div class="eye">       <div class="ball"></div>     </div>     <div class="eye">       <div class="ball"></div>     </div>   </div> <script>   var balls = document.getElementsByClassName("ball");   document.onmousemove = function(){     var x = event.clientX * 100 / window.innerWidth + "%";     var y = event.clientY * 100 / window.innerHeight + "%";     //event.clientX => get the horizontal coordi...

Courses to learn C#

In the link that we provide below, you can find books and material to start programming in C#. There is also material for people with a more advanced level in this type of programming language. Download links: Download

Courses to learn Python

In the link that we provide below, you can find books and material to start programming in Python. There is also material for people with a more advanced level in this type of programming language. Download links: Download

How to make a Christmas animation in HTML

Imagen
Code of index.html : <!DOCTYPE html> <html lang="en"> <head>     <meta charset="utf-8">     <title>HAPPY NEW YEAR</title>     <style>         body {             background-color: #424f6f;         }         h1 {             color: white;             margin-top: 250px;             font-size: 50px;             text-align: center;         }     </style> </head> <body> <h1 id="messageLabel"></h1> <script> var message = "Ha...

How to do a Color Background Changer in HTML

Imagen
Code of index.html : <!DOCTYPE html> <html lang="en" dir="ltr">   <head>     <meta charset="utf-8">     <title></title>     <link rel="stylesheet" href="style.css">     <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css">     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>   </head>   <body>   <div class="btn"><i class="fas fa-cog"></i></div>   <div class="box">     <h2>Enter a color</h2>     <div class="box-c">       <div class="txtb">         <input type="text" placeholder="#000000" id="hex">         <div class="prev"></div>...

How to do a Hangman in Python

Imagen
Code: from random import * import sys player_score = 0 computer_score = 0 def start():     print('Let’s play a game of Hangman.')     while game():         pass     scores() def game():     dictionary = ['Hola','Adiós']     word = choice(dictionary)     word_length = len(word)     clue = word_length * ['_']     tries = 6     letters_tried = ''     guesses = 0     letters_right = 0     letters_wrong = 0     global computer_score, player_score     def guess_letter():         print()         letter = input('Take a guess at our mystery word:')         letter.strip()         letter...

How to do a Clock in Python

Imagen
Code: #!/usr/bin/env python # -*- coding: utf-8 -*- from Tkinter import* import time root = Tk() root.focus() root.title("Clock") root.config(cursor='watch') time1 = '' clock = Label(root, font=('ubuntu', 30, 'bold'), bg='#3C3B37', fg='white', bd=0) clock.pack(fill=BOTH, expand=1) def tick():     global time1     time2 = time.strftime('%H:%M:%S')     if time2 != time1:         time1 = time2         clock.config(text=time2)     clock.after(200, tick) tick() root.mainloop()

How to do a Stopwatch with HTML

Imagen
Code: <!DOCTYPE html> <html> <head> <style>     body {         background-color: #e6e6e6;     }     h1 {         font-size: 4.5em;     }     button {         font-size: 30px;         width: 140px;         height: 60px;         border-radius: 5px;     }     #startPause {         background-color: green;         border-color: green;     }     #reset {         background-color: gray;         border-color: gray;     }     .container {    ...

How to do an Email Bomber with Python

Imagen
Code: import smtplib  #for SMTP Protocol import mimetypes #converts URL import sys #for System import time #time from email.MIMEText import MIMEText class SMTP(object):       def title(self):             print ("       PYTHON MAIL BOMBER IS WORKING :) ")       def SMTPconnect(self):             print( "We are in the SMTPconnect") #list of SMTP server - http://www.e-eeasy.com/SMTPServerList.aspx             self.smtpserver=raw_input("\nEnter SMTP server: ")             self.smtpport=input("Enter SMTP port (Usualy 25 or 465): ")             try:               ...

How to do a Spooky Ghost in HTML - Special Halloween

Imagen
Code of index.html : <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <meta http-equiv="X-UA-Compatible" content="ie=edge">     <title>Spooky Ghost</title>     <link rel="stylesheet" href="style.css"> </head> <body>     <div id="container">         <div id="spooky">             <div id="body">                 <div id="eyes"></div>                 <div id="mouth"></div>                 <div id="feet">     ...

How to do a Calculator in HTML

Imagen
Code: <!DOCTYPE html> <html lang="en"> <head>     <meta charset="utf-8">     <title>Calculadora</title>     <link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">     <style>         *{             font-family: 'Inconsolata', monospace;             color: #555;         }         body{             background-color: #3fb399;         }         .container{             width: 320px;             background-color: white;             margin: 12...

How to make a real-time HTML viewer

Imagen
Code: <html>     <head>         <title>Real Time Editor</title>     <body>         <SCRIPT language=JavaScript>             function right(e) {                 if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) {                 a=window.open("https://www.google.com","WindowName","width=640,height=600,top=40,left=50,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=no,location=no");                 return false;             }                 else if (navigator.appName == 'Microsoft Internet Explo...