The Fish

Size
1,919 Kb
Views
34,408

How do I make an the fish?

A Simple fish following the mouse :). What is a the fish? How do you make a the fish? This script and codes were developed by Christian Östman on 11 September 2022, Sunday.

The Fish Previews

The Fish - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>The Fish</title>
</head>
<body> <canvas id="theCanvas" width="800" height="600" style="background-color:black"></canvas> <script src='http://cdnjs.cloudflare.com/ajax/libs/EaselJS/0.7.1/easeljs.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

The Fish - Script Codes JS Codes

var fish;
var water;
function init()
{ water = new createjs.Bitmap("http://pg.asmallgame.com/water.jpg") stage.addChild(water); fish = new createjs.Bitmap("http://pg.asmallgame.com/fish.png") fish.x = 100; fish.scaleX = -.3; fish.scaleY= .3; stage.addChild(fish);
}
function draw()
{ fish.x = fish.x + (mouse.x - fish.x) * .02; fish.y = fish.y + (mouse.y - fish.y) * .02; if(fish.x > mouse.x) fish.scaleX = 0.3; else fish.scaleX = -0.3;
}
var stage = new createjs.Stage(document.getElementById('theCanvas'));
var stageWidth = document.getElementById('theCanvas').width; var stageHeight = document.getElementById('theCanvas').height;
var main = new createjs.Shape();
stage.addChild(main);
graphics = main.graphics;
createjs.Ticker.setFPS(40);
createjs.Ticker.addEventListener("tick",update);
function update()
{ draw(); stage.update();
}
mouse = {x: 0, y: 0};
document.addEventListener('mousemove', function(e){ mouse.x = e.clientX || e.pageX; mouse.y = e.clientY || e.pageY
}, false);
init();
The Fish - Script Codes
The Fish - Script Codes
Home Page Home
Developer Christian Östman
Username chribbe
Uploaded September 11, 2022
Rating 3
Size 1,919 Kb
Views 34,408
Do you need developer help for The Fish?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Christian Östman (chribbe) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!