The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Scripts & Tutorials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Reply
 
Thread Tools
  #1    
Old February 2nd, 2011, 12:39 PM
zingzags's Avatar
zingzags
Creator or Pokemon Serenity
 
Join Date: Jan 2009
Location: Boston
Age: 20
Nature: Adamant
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)
   [email protected]
 # end

# Kernel.pbAddPokemon(PBSpecies::MEW,20)
__________________
Pokemon Serenity is my fangame name.
name decided 12/15/09
Currently helping:
Pokemon ebony
and
Xenotime:
Reply With Quote
  #2    
Old February 2nd, 2011, 06:54 PM
thepsynergist's Avatar
thepsynergist
A Gym Leader, Kyushu Region
 
Join Date: Mar 2009
Location: California, USA
Age: 24
Gender: Male
Nature: Adamant
Send a message via Yahoo to thepsynergist Send a message via Skype™ to thepsynergist
Nice job. It works out great. Though I evented mine, and it doesn't look as snazzy.

EDIT: Just hit 500 posts. :D
__________________



My Youtube Channel: http://www.youtube.com/thepsynergist
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 03:03 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.