Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8125617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:52:38+00:00 2026-06-06T06:52:38+00:00

I’m doing some animation script in RPG Maker XP (made with ruby) that allow

  • 0

I’m doing some animation script in RPG Maker XP (made with ruby) that allow you to display moving images. My question here is not strictly about RPG Maker, but in general term. This is the code I found out so far and it works, but with problem :

class Poser
  attr_accessor :images

  def initialize 
    @images = Sprite.new
    @images.bitmap = RPG::Cache.picture('Character.png') #display picture 
    @images.x = 540 #place it on the bottom right corner of the screen
    @images.y = 180
  end

  def move(x,y)
    @images.x += x
    @images.y += y
  end

  def animate(x,y,step,delay) #Animate moving the picture up and down with delay
    forward = true
    2.times { #the first loop, do code 2 times of :
      step.times {
        wait(delay) #wait x frame
        if forward
          move(x/step,y/step) #move the picture down
        else
          move(-x/step,-y/step) #move the picture up
        end
      }
      wait(delay*3)
      forward = false
    }
  end

  def wait(time)
    while time > 0
      time -= 1
      Graphics.update
    end
  end
end

Then I create an instance of it and called the method :

$test = Poser.new
$test.animate(0,10,10,10)

What the above code do is to move the picture up and down (just like breathing animation, your head bob up and down)

As you can see, Im using loop functions to move the picture with delay. What I got is, I cannot do anything else until the animation finished. What I meant by “anything else” is such as walking around with my character, talk to NPC, I want to do those things while there is animation being played in the background. In the end, the game “paused” in the loop block.

Is there is another way to do animation without looping, or, anything that doesn’t “pause” the screen until animation is finished ? Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:52:40+00:00Added an answer on June 6, 2026 at 6:52 am

    Usually, games use a system called a game loop. A game loop is a loop in the main function of the program that executes as fast as it can. Each time it executes, it executes two functions (or these can be the body of the loop, that’s a design choice that you can make): draw and update (update, then draw).

    update‘s job is to change the positions of characters, usually by a formula of position=(x+pixelsPerSecond*secondsSinceLastTick,y+pixelsPerSecond*secondsSinceLastTick) (in game terminology, a tick is an iteration of the game loop). The system of a game loop is optimized for games, because every tick you can execute one tiny piece of each animation, fast enough together that they give an illusion of concurrency (game loops run many times per second).

    After update has changed the position of entire objects (eg. a fast NPC is now 5 pixels further to the left), draw is used to draw the scene. draw can do a couple of things. It can draw sprites at the locations indicated by update, and it can also maintain it’s own animations (small things like the animation of legs walking — update shouldn’t set the position of the legs in the walking animation, just the new position of the character for this tick).

    I’m not sure if I am exactly answering your question, as I know nothing about RPG Maker (so maybe you have to do something else completely), but because you said in general, this is what it is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.