Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Zoom script help

Hi,
Using the following XP script: viewtopic.php?f=11&t=67068&p=668741&hilit=zoom#p668741

I'm making a cutscene. In short, because of how I'm animating it, Midgar is a 640x480 characterset.

I want to "zoom in" on midgar, slowly, as the end of the cutscene.

Code:
 

# my attempts, didn't seem to do anything

class Interpreter

  def zoom_in_on_midgar

    x = 1.0

    y = 1.0

    for i in 0...100

      x += 0.1

      y += 0.1

      $game_player.zoom(x, y)

    end

  end

end

 

It's been a long while since I've used RMXP or RGSS, so I'm a bit rusty. Anyone got any ideas on how this could work?

The idea was it would slowly zoom in during the for loop.
 
All right. Instead of using a for loop, you'll want to add a counter and an if/else statement to the pertinent update method. The for loop you have will go from 0 to 99 before it ever manages to update the graphics. Instead, you want to initialize a counter as 0 when the class is called, and set it to 100 using this method. Then, in the update method, you'll check to see if it is above 0. If it is, you will perform the same code you had in the loop, and decrement the counter. This way it can actually update the graphics, as well. Also, the game runs at either 40 or 60 FPS (depending on whether it's XP or VX), so this won't exactly be a slow zoom of the camera.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top