diff --git a/Doom-In-Docker-master.zip b/Doom-In-Docker-master.zip deleted file mode 100644 index 6650d40b..00000000 Binary files a/Doom-In-Docker-master.zip and /dev/null differ diff --git a/Mario-game-master.zip b/Mario-game-master.zip new file mode 100644 index 00000000..865fc1dc Binary files /dev/null and b/Mario-game-master.zip differ diff --git a/Mario-game-master/Mario-game-master/index.html b/Mario-game-master/Mario-game-master/index.html new file mode 100644 index 00000000..90bf9f26 --- /dev/null +++ b/Mario-game-master/Mario-game-master/index.html @@ -0,0 +1,17 @@ + + + + + Mario + + + + + + + + + + + + diff --git a/Mario-game-master/Mario-game-master/script.js b/Mario-game-master/Mario-game-master/script.js new file mode 100644 index 00000000..90083cb3 --- /dev/null +++ b/Mario-game-master/Mario-game-master/script.js @@ -0,0 +1,122 @@ +window.addEventListener('load', function(){ + const canvas = document.getElementById('canvas1'); + const ctx = canvas.getContext('2d'); + canvas.width = window.innerWidth; + canvas.height = window.innerHeight; + + class Particle { + constructor(effect, x, y, color){ + this.effect = effect; + this.x = this.originX = x; + this.y = this.originY = y; + this.size = 2; + this.color = color; + this.dx = 0; + this.dy = 0; + this.vx = 0; + this.vy = 0; + this.force = 0; + this.angle = 0; + this.distance = 0; + this.friction = 0.98; + this.ease = 0.2; + } + update(){ + this.dx = this.effect.mouse.x - this.x; + this.dy = this.effect.mouse.y - this.y; + this.distance = this.dx * this.dx + this.dy * this.dy; + this.force = -this.effect.mouse.radius / this.distance; + if(this.distance < this.effect.mouse.radius) { + this.angle = Math.atan2(this.dy, this.dx); + this.vx += this.force * Math.cos(this.angle); + this.vy += this.force * Math.sin(this.angle); + } + this.x += (this.vx *= this.friction) + (this.originX - this.x) * this.ease; + this.y += (this.vy *= this.friction) + (this.originY - this.y) * this.ease; + } + } + + class Effect { + constructor(width, height){ + this.width = width; + this.height = height; + this.image = document.getElementById('image'); + this.centerX = this.width / 2; + this.centerY = this.height / 2; + this.x = this.centerX - this.image.width / 2; + this.y = this.centerY - this.image.height / 2; + this.particles = []; + this.gap = 2; + this.mouse = { + radius: 5000, + x: this.centerX, + y: this.centerY + } + window.addEventListener("mousemove", event => { + this.mouse.x = event.x; + this.mouse.y = event.y; + }); + + window.addEventListener("touchstart", event => { + this.mouse.x = event.changedTouches[0].clientX; + this.mouse.y = event.changedTouches[0].clientY; + }, false); + + window.addEventListener("touchmove", event => { + event.preventDefault(); + this.mouse.x = event.targetTouches[0].clientX; + this.mouse.y = event.targetTouches[0].clientY; + }, false); + + window.addEventListener("touchend", event => { + event.preventDefault(); + this.mouse.x = 0; + this.mouse.y = 0; + }, false); + } + init(context){ + context.drawImage(this.image,this.x, this.y); + var pixels = context.getImageData(0, 0, this.width, this.height).data; + var index; + for(var y = 0; y < this.height; y += this.gap) { + for(var x = 0; x < this.width; x += this.gap) { + index = (y * this.width + x) * 4; + const red = pixels[index]; + const green = pixels[index + 1]; + const blue = pixels[index + 2]; + const color = 'rgb(' + red + ',' + green + ',' + blue + ')'; + + const alpha = pixels[index + 3]; + if(alpha > 0) { + this.particles.push(new Particle(this, x, y, color)); + } + } + } + context.clearRect(0, 0, this.width, this.height); + } + update(){ + for(var i = 0; i < this.particles.length; i++) { + this.particles[i].update(); + } + } + render(context){ + context.clearRect(0, 0, this.width, this.height); + for(var i = 0; i < this.particles.length; i++) { + var p = this.particles[i]; + context.fillStyle = p.color; + context.fillRect(p.x, p.y, p.size, p.size); + } + } + } + + const effect = new Effect(canvas.width, canvas.height); + effect.init(ctx); + + function animate() { + effect.update(); + effect.render(ctx); + requestAnimationFrame(animate); + } + animate(); + +}); \ No newline at end of file diff --git a/Mario-game-master/Mario-game-master/style.css b/Mario-game-master/Mario-game-master/style.css new file mode 100644 index 00000000..5be2a9d6 --- /dev/null +++ b/Mario-game-master/Mario-game-master/style.css @@ -0,0 +1,17 @@ +canvas { + display: block; + position: absolute; + top: 0; + left: 0; + z-index: 1; +} +img { + display: none; +} +a { + color: black; + position: absolute; + bottom: 50px; + left: 20px; + z-index: 100; +} \ No newline at end of file diff --git a/Mario64Offline-main.zip b/Mario64Offline-main.zip deleted file mode 100644 index 995f3c2a..00000000 Binary files a/Mario64Offline-main.zip and /dev/null differ diff --git a/batu.html b/batu.html index a4858cb5..27992c8d 100644 --- a/batu.html +++ b/batu.html @@ -13,5 +13,6 @@ blades-in-the-dark Doom Mario64 +Mario fisiks \ No newline at end of file