Found an issue in SpiderBasic ? Please report it here !
User avatar
C.K.
 
Posts: 8
Joined: Thu Apr 26, 2018 9:51 am

[SB 2.21 B1] CopySprite() bug?

by C.K. Sat Sep 22, 2018 9:59 am

I can't get it to work

Code: Select all
CloseDebugOutput()
InitSprite()

EnableExplicit

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Procedure RenderFrame()
Static X

  X + 1
  ClearScreen( #Black )

  DisplaySprite( 0, X, 20 )
  If X = 100
    CopySprite( 0, 1 )
  EndIf
  If X > 100
    DisplaySprite( 1, X + 20, 200 )
  EndIf

  FlipBuffers()
EndProcedure
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Procedure Main()
  OpenWindow ( 0, #PB_Ignore, #PB_Ignore, #PB_Ignore, #PB_Ignore, "...", #PB_Window_Background )
  OpenScreen ( WindowWidth(0), WindowHeight(0), #PB_Ignore, "[SB 2.21 beta 1] CopySprite Test" )
  CloseWindow( 0 )

  CreateSprite( 0, 32, 32 )
  StartDrawing( SpriteOutput( 0 ) )
  Box( 0, 0, 32, 32, #Magenta )
  Box( 8, 8, 16, 16, #Yellow  )
  StopDrawing()

  BindEvent( #PB_Event_RenderFrame, @RenderFrame() )
  FlipBuffers()
EndProcedure
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

;{
Main()
;}


Error reported from Google Chrome:
spiderbasic.js:formatted:6073 Uncaught ReferenceError: spider_CopySprite is not defined
at Object.f_renderframe [as function f_renderframe() {
so_renderframe$v_x=(so_renderframe$v_x+1);
spider_ClearScreen(0);
spider_DisplaySprite(0,so_renderframe$v_x,20);
if (so_renderframe$v_x==100) {
spider_CopySprite(0,1);
}
if (so_renderframe$v_x>100) {
spider_DisplaySprite(1,(so_renderframe$v_x+20),200);
}
spider_FlipBuffers();
return 0;
Return to Bugs Reports

Who is online

Users browsing this forum: No registered users and 2 guests