Count steps only when move Y direction

MlhaStudio

Warper
Member
Joined
Mar 24, 2021
Messages
2
Reaction score
0
First Language
Czech
Primarily Uses
RMMV
Hi
This is my first post here, so sorry if it is in wrong thread.
i Am making game that is something like frogger. to achieve to higher score you must get upper on screen.
i Can make variable which checks Y position, but if player start down, he starting with 255 score and it goes up.
I am not too experienced with variables, but i think it cant be that hard.
Thanks for any help.
 

rexie09

Villager
Member
Joined
Apr 4, 2021
Messages
17
Reaction score
5
First Language
English
Primarily Uses
RMMZ
Think of y as reversed so as the payer goes up the y goes down and as the player goes down the y goes up. you could make a temp variable that is also set the the players initial y and then subtract the value of the initial y by the y of the player to get the diff.
Code:
//DO NOT CHANGE
let yTemp = $gamePlayer._y;
//This will set the value to 0 when the player spawns
let score = yTemp - $gamePlayer._y;
//on each step you would then have to update the variable
 
Last edited:

MlhaStudio

Warper
Member
Joined
Mar 24, 2021
Messages
2
Reaction score
0
First Language
Czech
Primarily Uses
RMMV
Think of y as reversed so as the payer goes up the y goes down and as the player goes down the y goes up
Thanks, i will try that tonight
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

A new RPG Maker music pack is coming out soon! Below is a demo of one of the compositions in the pack, Heroic Battle. More details coming soon!

Trying to build a child-size body. Mostly happy with it except the sideview arms - can't get them to move quite right yet. Anyway, here's the work-in-progress, with an adult for size comparison.
ChildTest-01.gif

I started in VXAce and I liked how the kids flapped their arms so that's why it's just flapping.
A character theme... finally posted some of the music tonight as celebration for 500 followers. I really like how this song came out.
Good night (or day) everyone! :kaohi:
Stimpaks and More.png

WIP of Stimpaks, Radaway, Jet and Psycho. Mentats soon to come. :D

Forum statistics

Threads
111,126
Messages
1,058,556
Members
144,352
Latest member
Boyboy180
Top