Change current parallax's speed/graphic

Status
Not open for further replies.

IsFutureBright

Lightning Bolt Action
Veteran
Joined
Dec 26, 2012
Messages
120
Reaction score
11
First Language
Portuguese
Primarily Uses
Is there any script call to do something like:

@game_map.parallax.speed +=1@game_map.parallax.setGraphic("mountainNight");I'm asking cause I'm working a runner kinda game and want to have the background speed up and change during game.
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,306
Reaction score
1,575
First Language
English
Primarily Uses
RMMZ
Does using the 'Change Parallax Back' event command on tab 3 do what you are after?
 

IsFutureBright

Lightning Bolt Action
Veteran
Joined
Dec 26, 2012
Messages
120
Reaction score
11
First Language
Portuguese
Primarily Uses
It could do the job with some if-elses but If I could just increment the speed based on the current speed directly, I'd rather.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Game Interpreter will show you the script call for each of the event commands.


Try this:


$game_map.change_parallax(name, loop_x, loop_y, sx, sy)


The one thing I'd question is whether it would reset the parallax to the original position, or just keep it where it is and change the speed.


If it doesn't work, you'd have to write a method to accept the parameters and just change those variables you want to change - or make them attr_accessors and change them individually via a script call.
 

IsFutureBright

Lightning Bolt Action
Veteran
Joined
Dec 26, 2012
Messages
120
Reaction score
11
First Language
Portuguese
Primarily Uses
Game Interpreter will show you the script call for each of the event commands.

Try this:

$game_map.change_parallax(name, loop_x, loop_y, sx, sy)

The one thing I'd question is whether it would reset the parallax to the original position, or just keep it where it is and change the speed.

If it doesn't work, you'd have to write a method to accept the parameters and just change those variables you want to change - or make them attr_accessors and change them individually via a script call.
Thanks Shaz that works just like you said and it doesn't reset the image back. I made a quick function for what I needed, posting it below for anyone interested:

Code:
 def increase_parallax_speed(sx, sy)    @parallax_sx += sx    @parallax_sy += sy  end
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top