• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

My present to the Community - starter Pokémon choosing screen

zingzags

PokemonGDX creator
536
Posts
15
Years
Well sense today is my birthday, I decided to share my first script for my pokemon game, Enjoy and give credits.

Code:
################################################################################
# CREATED BY ZINGZAGS OF POKECOMMUNITY AND PLANETDEV
# Starter Pokemon Option Screen
# THIS IS TO MAKE A CUSTOM STARTER CHOOSING SCENE LIKE IN ACUTAL POKEMON GAMES
# VERSION TWO OF THE SCRIPT (FINAL)
################################################################################


class SceneTable
  
  def pbUpdate
   pbUpdateSpriteHash(@sprites)
  end
 
  def pbEndScene
   pbDisposeSpriteHash(@sprites)
   @viewport.dispose
  end
  
  
  def pbStartScene
    @sprites={}
    @viewport=Viewport.new(0,0,$Graphics_widthx2, $Graphics_heightx2)
    @viewport.z=99999
    
    @sprites["bg"]=Sprite.new(@viewport)
    @sprites["bg"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/bottombger")
    @sprites["bg"].x=0
    @sprites["bg"].y=400
    @sprites["bg"].z=0
    
    @sprites["bgt"]=Sprite.new(@viewport)
    @sprites["bgt"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/touch up.png")
    @sprites["bgt"].x=0
    @sprites["bgt"].y=289
    @sprites["bgt"].z=0    
    
    @sprites["1"]=Sprite.new(@viewport)
    @sprites["1"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/pokeballC")
    @sprites["1"].x=124
    @sprites["1"].y=500
    @sprites["1"].z=1
    
    @sprites["2"]=Sprite.new(@viewport)
    @sprites["2"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/pokeballC")
    @sprites["2"].x=198
    @sprites["2"].y=500
    @sprites["2"].z=1
    
    @sprites["2"]=Sprite.new(@viewport)
    @sprites["2"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/pokeballC")
    @sprites["2"].x=272
    @sprites["2"].y=500
    @sprites["2"].z=1
    
    
   
    @sprites["overlay"]=BitmapSprite.new($Graphics_widthx2,784,@viewport)
    @sprites["overlay"].z=1
    overlay=@sprites["overlay"].bitmap
    overlay.clear
    baseColor=Color.new(12*8,12*8,12*8)#(255,255,240)
    shadowColor=Color.new(255,255,240)#(12*8,12*8,12*8)
    pbSetSystemFont(@sprites["overlay"].bitmap)
    textPositions=[
     ["Please click on one of the pokeballs       ",420,306,true,baseColor,shadowColor],
   #   ["POKEBALL's                      ",423,146,true,baseColor,shadowColor],
     ["to choose your starting pokemon.            ",428,333,true,baseColor,shadowColor],
     ]
    pbDrawTextPositions(overlay,textPositions)
  end 
  
  def pbScene
  loop do
    Graphics.update
    Input.update
    pbUpdate
    
   #  Kernel.pbMessage(_INTL("There are three pokemon here, each one of these red ball, or PokeBall contains one Pokemon."))
    # Kernel.pbMessage(_INTL("Please choose your starting pokemon that you will journey out with."))
    
      if pbMouseInAreaLeft?(124, 500, 74, 74)
      
      pbPlayDecisionSE()
        Kernel.pbMessage(_INTL("The pokemon that is inside this pokeball is TURTWIG")) 
      if !Kernel.pbConfirmMessageSerious(
         _INTL("Are you sure you want to have TURTWIG as your starter pokemon?"))
         Kernel.pbMessage(_INTL("Please make a decision before you act next time."))
         else
          Kernel.pbAddPokemon(PBSpecies::TURTWIG,05)
          break
      
      end
    end
    
     
  if pbMouseInAreaLeft?(198, 500, 74, 74)
       
      pbPlayDecisionSE()
        Kernel.pbMessage(_INTL("The pokemon that is inside this pokeball is CHARMANDER")) 
      if !Kernel.pbConfirmMessageSerious(
         _INTL("Are you sure you want to have CHARMANDER as your starter pokemon?"))
         Kernel.pbMessage(_INTL("Please make a decision before you act next time."))
         else
          Kernel.pbAddPokemon(PBSpecies::CHARMANDER,05)
          break
  
      end
    end
    
       if pbMouseInAreaLeft?(272, 500, 74, 74)
       
      pbPlayDecisionSE()
        Kernel.pbMessage(_INTL("The pokemon that is inside this pokeball is PIPLUP")) 
      if !Kernel.pbConfirmMessageSerious(
         _INTL("Are you sure you want to have PIPLUP as your starter pokemon?"))
         Kernel.pbMessage(_INTL("Please make a decision before you act next time."))
         else
          Kernel.pbAddPokemon(PBSpecies::PIPLUP,05)
          break
    
      end
    end
  end
end
  end

class TableScreen
 def initialize(scene)
  @scene = scene
 end
 def pbStartScreen
  @scene.pbStartScene
  @scene.pbScene
  @scene.pbEndScene
 end
end
#
#
#  Here is how a script would initialize SceneMine:
#  
#  pbFadeOutIn(99999){
#    scene=SceneTable.new
#    screen=TableScreen.new(scene)
#    screen.pbStartScreen
#  }


# def pbEndScene
   
  # pbFadeOutAndHide(@sprites) { pbUpdate }
   #pbDisposeSpriteHash(@sprites)
   #@viewport.dispose
 # end

# Kernel.pbAddPokemon(PBSpecies::MEW,20)
 

thepsynergist

Vinemon: Sauce Edition Programmer and Composer
795
Posts
15
Years
Nice job. It works out great. Though I evented mine, and it doesn't look as snazzy.

EDIT: Just hit 500 posts. :D
 
95
Posts
9
Years
Did you renamed Luka's mouse methods? it is called $mouseInAreaLeft? and not pbMouseInAreaLeft.
i addition to that, are you sure that
Code:
@sprites["bgt"].bitmap = BitmapCache.load_bitmap("Graphics/Pictures/touch up.png")
won't give you an error?
and what about
Code:
$Graphics_widthx2
?
this variable doesn't exists in Essentials.
what you probably mean is
Code:
Graphics.width*2
?
I am sure using your script would've give an instant error.
and btw, what is wrong with my Starter Selection?

and where are the Graphics for the Script?
 
Back
Top