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.

Slight Problem

Well I've been working on a "morphing" system. In a game where you can chose between at least 100 diffrent sprites to begin with. And I've encountered a problem. The shifting works fine. Transforming back however.. is slightly more difficult... Is there any way to save the old character sprite in a variable and change the actor sprite, without editing this variable?
If not... any hints?
 

Mac

Member

Well first you would need to store it, so you would add something like this to Game System:-

Code:
  def morph_store
    @stored_morph = @current_morph
  end

 def morph_back
    transform(@stored_morph)
  end

Then go into Game Temp and add another attr_accessor like this:-
Code:
  attr_accessor :morph

The lower down elow the accessors add something like this:-
Code:
@morph = nil

And then you would need to do something like this in Scene Battle:-

Code:
def morph
    $game_temp.morph = $game_system.current_morph

And hopefully something like that should do the trick.
 

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