xxxxxxxxxx
let scene = 0;
let canvas_x = 640;
let canvas_y = 480;
let bottle_x = 60;
let bottle_y = 30;
let point_alpha = 255;
let new_mouseY;
let save_x;
let save_y;
let d;
let throw_flag = false;
let power;
let sin_power;
let cos_power;
let g = 1157;
let time_threw;
let time_throwing;
let close;
let open;
let nomu_x;
let nomu_y;
let image_size = 180;
let first_position_flag = true;
let move_x = 0;
let move_y = 0;
let mouse_open = false;
let score = 0;
let char_color = [];
let old_char_color = [];
function preload()
{
close = loadImage("mouse_close.png");
open = loadImage("mouse_open.png");
}
function setup()
{
createCanvas(canvas_x, canvas_y);
rectMode(CENTER);
ellipseMode(CENTER);
textAlign(CENTER, CENTER);
imageMode(CENTER);
for (let i = 0; i < 9; i++)
{
let r = random(0, 255);
let g = random(0, 255);
let b = random(0, 255);
old_char_color[i] = [r, g, b];
}
}
function draw()
{
background(255);
translate(0, canvas_y);
scale(1, -1);
if (scene == 0 || scene == 1)
{
init();
}
if (scene == 0)
{
bottle();
new_mouseY = - (mouseY - canvas_y);
throw_point();
}
if (scene == 1)
{
throw_bottle();
judge();
}
if (scene == 2)
{
display();
}
}