- Joined
- Mar 26, 2019
- Messages
- 64
- Reaction score
- 29
- First Language
- English
- Primarily Uses
- RMMV
Howdy, folks-
I started on a basic script which uses @Aramis-IX 's Sprite Zoom plugin to increase/decrease the player's size depending on where they are located on a map's Y axis to create the illusion of depth/distance.
Rather than have it run as a parallel process, I tried adding an event listener (as per @Jonforum / @Kino 's tutorial):
The problem is, it seems to be a bit wonky- the Player continues moving for a few steps even after the up or down buttons are pressed, creating a disconnect between the controls and the actor.
Is there a better way of going about accomplishing what I am trying to do?
Also, any suggestions on how I can improve my equations so that the player is regular sized in the middle of the screen, supersized at the bottom of the screen, and tiny at the top?
Thanks in advance for your help!
I started on a basic script which uses @Aramis-IX 's Sprite Zoom plugin to increase/decrease the player's size depending on where they are located on a map's Y axis to create the illusion of depth/distance.
Rather than have it run as a parallel process, I tried adding an event listener (as per @Jonforum / @Kino 's tutorial):
Code:
scale_player = function(event){
var gp_id = ($gamePlayer._realY + 1) / $dataMap.height;
if ($gameVariables.value(10) != gp_id) {
SpriteZoom.zoom(0,gp_id);
$gamePlayer.setMoveSpeed(Math.round(($gamePlayer._realY + 1) * (6/$dataMap.height)));
$gameVariables.setValue(10,gp_id);
};
};
document.addEventListener('keydown', scale_player);
The problem is, it seems to be a bit wonky- the Player continues moving for a few steps even after the up or down buttons are pressed, creating a disconnect between the controls and the actor.
Is there a better way of going about accomplishing what I am trying to do?
Also, any suggestions on how I can improve my equations so that the player is regular sized in the middle of the screen, supersized at the bottom of the screen, and tiny at the top?
Thanks in advance for your help!
Last edited: