- 16
- Posts
- 5
- Years
- Seen May 1, 2023
Hi Guys, i have a little problem with animating a Pokeball for my Starter Selection Screen.
I am working with a spritesheet with 4 frames and woud like the Pokeball to animate when it is selected. I am working with the Advanced Starter Selection Script by shiney.
I also looked into the Xtransceiver script by KleinStudios but cant really seem to figure out hov animating the parts work.
My script looks like this:
I only copied the relevant blocks to make the reading easier. I will also attach an image of the ball sprite sheet.
Would really appreciate some help even if its just a hint as to which sections i should look into.
I am working with a spritesheet with 4 frames and woud like the Pokeball to animate when it is selected. I am working with the Advanced Starter Selection Script by shiney.
I also looked into the Xtransceiver script by KleinStudios but cant really seem to figure out hov animating the parts work.
My script looks like this:
Code:
@sprites["ball_1"]=IconSprite.new(0,0,@viewport)
@sprites["ball_1"].setBitmap("Graphics/Pictures/StarterSelection/ball1")
@sprites["ball_1"].src_rect.width = @sprites["ball_1"].bitmap.width/4
@sprites["ball_1"].src_rect.height = @sprites["ball_1"].bitmap.height
@sprites["ball_1"].x=146
@sprites["ball_1"].y=163
@sprites["ball_1"].opacity=0
@ballcount=0
def openscene
@sprites["bg"].opacity=255
@sprites["bag"].opacity=255
@sprites["ball_1"].opacity=255
@sprites["ball_2"].opacity=255
@sprites["ball_3"].opacity=255
@sprites["select"].opacity=255
pbWait(1)
self.update
self.gettinginput
self.input_action
end
def update
@ballcount+=1
if select=1
if @ballcount==8
@sprites["ball_1"].src_rect.x = @sprites["ball_1"].src_rect.width
elsif @ballcount==16
@sprites["ball_1"].src_rect.x = @sprites["ball_1"].src_rect.width*2
elsif @ballcount==24
@sprites["ball_1"].src_rect.x = @sprites["ball_1"].src_rect.width*3
elsif @ballcount==32
@sprites["ball_1"].src_rect.x = @sprites["ball_1"].src_rect.width*4
elsif @ballcount==48
@sprites["ball_1"].src_rect.width
@ballcount=0
end
end
end
Would really appreciate some help even if its just a hint as to which sections i should look into.