Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // MapScroll.js
- //=============================================================================
- /*:
- * @plugindesc Scrolls the map when you get to the edge.
- * @author Jeremy Cannady
- *
- *
- * @help Scrolls the map when you get to the edge, normal maps are 12 by 16
- * If there are any problems let me know.
- *
- *
- *
- *
- */
- //Completely superseding the updateScroll function.
- Game_Player.prototype.updateScroll = function(lastScrolledX, lastScrolledY) {
- var x1 = lastScrolledX;
- var y1 = lastScrolledY;
- var x2 = this.scrolledX();
- var y2 = this.scrolledY();
- //Checks to see if we move beyond the screen if we do then it scrolls it for us.
- //startScroll(direction,distance,speed)
- if (y2 > 12.5) {
- $gameMap.startScroll(2,13,6);
- }
- if (x2 > 16.5) {
- $gameMap.startScroll(6,17,6);
- }
- if (x2 < -0.5) {
- $gameMap.startScroll(4,17,6);
- }
- if (y2 < -0.5) {
- $gameMap.startScroll(8,13,6);
- };
- };
- //Completely superseding the canMove function.
- Game_Player.prototype.canMove = function() {
- if ($gameMap.isEventRunning() || $gameMessage.isBusy()) {
- return false;
- }
- if (this.isMoveRouteForcing() || this.areFollowersGathering()) {
- return false;
- }
- if (this._vehicleGettingOn || this._vehicleGettingOff) {
- return false;
- }
- if (this.isInVehicle() && !this.vehicle().canMove()) {
- return false;
- }
- //Check to see if we are moving the map, if we are then don't let us move yet.
- if ($gameMap.isScrolling()){
- return false;
- }
- return true;
- };
Advertisement
Add Comment
Please, Sign In to add comment