0% found this document useful (0 votes)
75 views2 pages

Norecoil FFH4G

This document defines classes for a Pointer, WeaponController, and Time. It also defines functions for configuring a pointer, multiplying its sensitivity, and getting its value. The main logic sets up an interval to call these functions and the WeaponController's update method, alternating whether the game is inside or outside to demonstrate different pointer behavior.

Uploaded by

Adi Pratama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views2 pages

Norecoil FFH4G

This document defines classes for a Pointer, WeaponController, and Time. It also defines functions for configuring a pointer, multiplying its sensitivity, and getting its value. The main logic sets up an interval to call these functions and the WeaponController's update method, alternating whether the game is inside or outside to demonstrate different pointer behavior.

Uploaded by

Adi Pratama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

// YOUTUBE @H44LANDG

class Pointer {
constructor() {
this.x = 0.0;
this.y = 0.0;
}
}

class WeaponController {
constructor() {
this.random = () => Math.random();
}

update() {
if (insideGame) {
// YOUTUBE H@44LANDG
}

const mouseX = this.getAxis("Mouse X") * 9000.0 * Time.deltaTime;


const mouseY = this.getAxis("Mouse Y") * 9000.0 * Time.deltaTime;

if (this.getButtonDown("Fire1")) {
if (insideGame) {
this.fireBullet();
}
}
}

getAxis(axis) {
if (axis === "Mouse X") {
return (Math.random() * 200 - 100) / 100.0;
} else if (axis === "Mouse Y") {
return (Math.random() * 200 - 100) / 100.0;
}
return 0.0;
}

getButtonDown(button) {
if (button === "Fire1") {
return Math.random() < 0.5;
}
return false;
}

fireBullet() {
// YOUTUBE H@44LANDG
}
}

class Time {
static deltaTime = 0.0167;
}

let insideGame = true;


const myPointer = new Pointer();
const weaponController = new WeaponController();

function configuration(point) {
point.x = 9000.0;
point.y = 9000.0;
}

function multiplierSensitivity(point) {
if (insideGame) {
const sensitivity = 9000.0;
point.x = point.x * Math.PI / sensitivity;
point.y = point.y * Math.PI / sensitivity;
} else {
point.x = 0.0;
point.y = 0.0;
}
}

function value(point) {
return point.x + point.y;
}

// YOUTUBE @H44LANDG
const delayMillis = 1000 / 60; // 60 FPS aproximadamente
setInterval(() => {
configuration(myPointer);

insideGame = true;
multiplierSensitivity(myPointer);
console.log("Valor dentro del juego: " + value(myPointer));

insideGame = false;
multiplierSensitivity(myPointer);
console.log("Valor fuera del juego: " + value(myPointer));

weaponController.update();

// YOUTUBE H@44LANDG
}, delayMillis);

You might also like