+
Skip to content

Conversation

Arman-AIi
Copy link
Contributor

*Not using requestAnimationFrame anymore

Copy link
Contributor

@juni-purr juni-purr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very incomplete, has no buttons support, has bad practices and needs more refinement.

import { Vec } from "@common/utils/vector";
import $ from "jquery";
import nipplejs, { type JoystickOutputData } from "nipplejs";
import * as PIXI from "pixi.js";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not import everything from pixijs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, now it only imports ticker

shootOnRelease = false;
});
}
const ticker = new PIXI.Ticker();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use Game class's pixi ticker

const ticker = new PIXI.Ticker();
ticker.stop();
ticker.add(() => {
const gamepads = navigator.getGamepads();
Copy link
Contributor

@juni-purr juni-purr Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you use Game's pixi ticker, put this into its own method

this.turning = true;
const activePlayer = game.activePlayer;
if (game.console.getBuiltInCVar("cv_responsive_rotation") && !game.gameOver && game.activePlayer) {
game.activePlayer.container.rotation = this.rotation;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't there a better way to do this in the Player class?

const ticker = new PIXI.Ticker();
ticker.stop();
ticker.add(() => {
const gamepads = navigator.getGamepads();
Copy link
Contributor

@juni-purr juni-purr Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you really need to call this method every frame, is it required?

fix: only imported ticker instead of all of pixi.js
import $ from "jquery";
import nipplejs, { type JoystickOutputData } from "nipplejs";
import * as PIXI from "pixi.js";
import { Ticker } from "pixi.js";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still wrong, use the Game update method

@Arman-AIi Arman-AIi changed the title Controller joysticks Controller support Nov 16, 2024
hsanger and others added 30 commits December 24, 2024 10:02
also updated cute english (again)
Updated changelog.
Bumped protocol version.
Bumped package.json version number.
Set mode to fall in constants.
Map to fall in config.ts.
Updated game bg.
Updated embed bg.
Updated github bg.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载