RMMZ Moving an event or the player by a certain amount of pixels

McSundae

Regular
Regular
Joined
Oct 28, 2015
Messages
222
Reaction score
223
First Language
German
I was experimenting with an plugin to cause the player to bounce away from an onMap enemy like you know it from SNES or Gameboy Zelda Titles.

I used $gamePlayer._x to alternate the position of the sprite which actually worked, but it let me bounce into walls and if you enter a float value to just bounce a quarter tile for example the player controller seems not to know where he currently is and you are not able to walk any longer.

Anyone got an idea how to alternate position without getting stuck between tiles? Maybe there is even an plugin that i just didn't found to do the trick
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,701
Reaction score
11,283
First Language
English
Primarily Uses
RMMV
It would be helpful if you showed your event that wasn't working, we could offer help.

If I change $gamePlayer._x and then change it back (to make the player bounce then go back), it moves perfectly fine afterward.
 

McSundae

Regular
Regular
Joined
Oct 28, 2015
Messages
222
Reaction score
223
First Language
German
Yes, you are right. Sadly i don't want to bounce back, i just want to bounce away when the player is hit by enemy or the enemy is hit by the player.

Moving the player or event by an integer number doesn't lead to any issues, but when i add for example $gamePlayer._x += 0.2 the player gets stuck between two fields and isn't able to move anylonger.
 

Latest Threads

Latest Profile Posts

linkedin - Instagram 1 - Instagram 2 [OFF] - Tumblr texts [IN PORTUGUES]
"Understanding others is the greatest life lesson we can learn."
Tfw I was too slow to post in the latest AI art thread :'(

I had a doozy lined up, too
Updated my game's development post with the first video of it in action!


'Milestone Get!' :p
Heh, heh. I've been experimenting with a naughty word detector Common Event and using scripts to check certain strings. I never thought I would see such language in computer code. I would post a screen shot, but it probably wouldn't be appropriate, even with a Spoiler. But it certainly makes me laugh and it works great.

Forum statistics

Threads
136,809
Messages
1,270,280
Members
180,567
Latest member
CaptainAwf
Top