Grid engine failing to snap to grid after version >= 2.17.0
See original GitHub issueHey folks!
I’m creating a MMORPG here and this lib is one of my critical libs. My character suddenly stopped to snap to the grid after I was updating my dependencies about 2 days ago. It took me almost 8 hours to realize that this was because I had a:
"grid-engine": "^2.12.0",
On my package.json, so yarn was automatically updating it to the latest version (2.19.0)
Once I figured out the problem, I noticed that it started from 2.17.0 above.
Here’s my implementation code:
import { FromGridX, FromGridY, ToGridX, ToGridY } from '@rpg-engine/shared';
import { IComponent } from '../../abstractions/ComponentService';
import { Entity } from '../../abstractions/Entity';
export class EntityGrid implements IComponent {
private gameObject: Entity;
public init(targetObject: Entity) {
this.gameObject = targetObject;
}
public awake() {
// this whole offset and displayOrigin adjustments are required because our entity sprites are 32x32 while our tileset is 16x16
this.gameObject.scene.grid.addCharacter({
id: this.gameObject.id,
sprite: this.gameObject,
// walkingAnimationMapping: 6,
startPosition: {
x: ToGridX(this.gameObject.x),
y: ToGridY(this.gameObject.y),
},
speed: this.gameObject.speed,
charLayer: 'character',
collides: false,
});
// make sure our sprite position and grid position are the same, to avoid inconsistencies
const { x: gx, y: gy } = this.gameObject.scene.grid.getPosition(this.gameObject.id);
this.gameObject.x = FromGridX(gx);
this.gameObject.y = FromGridY(gy);
}
}
My fix was rolling back to the 2.16.0 version.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Change Log (Unreal Engine) - Dungeon Architect
Version 2.17.0 · Critical Fix Fixed a crash bug in stand alone builds when using the snap map builder and level streaming ·...
Read more >Finding applications that use Log4J - runZero
Log4J versions since 2.0 are reported to contain this vulnerability, which was originally disclosed to Apache several weeks ago by the security ...
Read more >Things don't snap to grid - Bugs - Corel Vector discussion
Chromebook (12239.92.0)/ web-based version 2020-1.3.1/ ... I'm having problems with is the black box) when I try to snap to grid it only...
Read more >Hookpad Release Notes 2.11 - 2.17 - Hooktheory Forum
These are archival release notes from version 2.11 - 2.17 of Hookpad ... 2.17.0 (2020.08.25) ... New app setting for cursor snap grid....
Read more >PlanGrid FAQs - Comparably
PlanGrid FAQs. PlanGrid's Frequently Asked Questions page is a central hub where its customers can always go to with their most common questions....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Annoraaq it seems to have solved. Thank you!
I just patched a bug related to the offset in v2.19.1. Can you check, if that solves your problem?