Hello there,
I've been developing a game in where you click on events/npcs to activate them. My character graphics are tall, taking up two tiles in height:
var alias_AstraCat_customEventUpdateForChecks = Game_Event.prototype.update;//If an event is clicked and the player is adjecent to it, start that eventGame_Event.prototype.update = function() { alias_AstraCat_customEventUpdateForChecks.call(this); //if mouse hovering over event if ((this._x == MouseXGrid && this._y == MouseYGrid) || (this._x == MouseXGrid && this._y-1 == MouseYGrid)) { //if player clicks if (TouchInput.isTriggered()) { //if player is adjecent to event if (($gamePlayer._x+1 == this._x && $gamePlayer._y == this._y) || ($gamePlayer._x-1 == this._x && $gamePlayer._y == this._y) || ($gamePlayer._x == this._x && $gamePlayer._y-1 == this._y) || ($gamePlayer._x == this._x && $gamePlayer._y+1 == this._y)) { //few more checks before starting if (!$gameMap.isEventRunning()) { if (!this.isJumping() && this.isNormalPriority()) { //start event this.start(); } } } } }};It's all working fine, but I just have to add in something like "if (event.graphic is tall)"
I would think you could check a sprites height...but then how do you go about checking the sprite of the current event within it's own function? Maybe it's through a global value like $gameMap or something?
I guess what I'm saying is that I need something like:
this.spriteHeight;Am I on the right track? A big character means it's a tall character right?
I've been developing a game in where you click on events/npcs to activate them. My character graphics are tall, taking up two tiles in height:
var alias_AstraCat_customEventUpdateForChecks = Game_Event.prototype.update;//If an event is clicked and the player is adjecent to it, start that eventGame_Event.prototype.update = function() { alias_AstraCat_customEventUpdateForChecks.call(this); //if mouse hovering over event if ((this._x == MouseXGrid && this._y == MouseYGrid) || (this._x == MouseXGrid && this._y-1 == MouseYGrid)) { //if player clicks if (TouchInput.isTriggered()) { //if player is adjecent to event if (($gamePlayer._x+1 == this._x && $gamePlayer._y == this._y) || ($gamePlayer._x-1 == this._x && $gamePlayer._y == this._y) || ($gamePlayer._x == this._x && $gamePlayer._y-1 == this._y) || ($gamePlayer._x == this._x && $gamePlayer._y+1 == this._y)) { //few more checks before starting if (!$gameMap.isEventRunning()) { if (!this.isJumping() && this.isNormalPriority()) { //start event this.start(); } } } } }};It's all working fine, but I just have to add in something like "if (event.graphic is tall)"
I would think you could check a sprites height...but then how do you go about checking the sprite of the current event within it's own function? Maybe it's through a global value like $gameMap or something?
I guess what I'm saying is that I need something like:
this.spriteHeight;Am I on the right track? A big character means it's a tall character right?