This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hello all,
I'm currently making an isometric game using tiles based off of Shaun Spalding's isometric game rendering tutorial. I have the system down, I just can't seem to find a good way to handle collisions. It seems that any object I place into the room goes wherever it feels like. With an adjustment of 1 pixel throwing the object across the room.
Here is the macros script:
function macros(){
#macro MAP_W 64
#macro MAP_H 120
#macro TILE_W 32
#macro TILE_H 16
#macro SCREEN_W 1024
#macro SCREEN_H 1920
enum TILE{
SPRITE = 0,
Z = 1
}
}
Here is the ScreenToTileX and ScreenToTileY script:
function ScreenToTileX(){
var _screenX = argument0 - (SCREEN_W * 0.5);
var _screenY = argument1 - (SCREEN_H * 0.25);
return floor((_screenX / (TILE_W * 0.5) _screenY / (TILE_H * 0.5) ) * 0.5);
}
function ScreenToTileY(){
var _screenX = argument0 - (SCREEN_W * 0.5);
var _screenY = argument1 - (SCREEN_H * 0.25);
return floor((_screenY / (TILE_H * 0.5) - (_screenX / (TILE_W * 0.5)))*0.5);
}
Here is the TileToScreenX and TileToScreenY script:
function TileToScreenX(){
var _tX = argument0;
var _tY = argument1;
return ((_tX - _tY) * (TILE_W * 0.5)) (SCREEN_W * 0.5);
}
function TileToScreenY(){
var _tX = argument0;
var _tY = argument1;
return ((_tX _tY) * (TILE_H * 0.5)) (SCREEN_H * 0.25);
}
Any help in just understanding how I would program like collisions and stuff would be greatly appreciated, thank you!
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/gamemaker/c...