BlitzCoder Essentials
•
Home Page
•
About BlitzCoder
•
Contributors
•
Terms of Use
•
Email Us
Main Areas
•
BlitzCoder Chat
•
Discussions
•
Articles/Tutorials
•
Code Database
•
Link Database
•
Showcase Area
•
Worklogs
•
Competitions
Special Areas
•
Undocumented
Other Blitz Sites
•
Blitz Basic Home
•
Blitz Showcase
•
BlitzPlay Library
Forum Login
Username:
Password:
•
Register Now!
BlitzCoder Code Archives Page
Main Codes Page
"Function scrollXY"
, by 86it
Scroll background using a joypad in x,y cords
Code
;------------------------------------ ; ******* ******* ** ** ; ** ** ** ****** ; ******* ******* ** ** ; ** ** ** ** ** ** ; ** ** ** ** ** ** ; ******* ******* ** ** ;http://64.40.92.90 ;------------------------------------ ;constants Const ScreenWidth=320, ScreenHeight=240 ;globals Global info1$="Function scrollXY" Global gfxBack Global x=0 Global y=0 ;------------------------------------ ;------------------------------------ ;setup AppTitle info1$ Graphics ScreenWidth,ScreenHeight,32 SetBuffer BackBuffer() gfxBack01=LoadImage("your background image") SplashScreen ;------------------------------------ ;loop While Not KeyDown( 1 ) Cls scrollXY(gfxBack01,JoyXDir(),JoyYDir()) Flip Wend End ;------------------------------------ Function scrollXY(Img$,scrollX,scrollY) If scrollX=1 x=x+2 ElseIf scrollX=-1 x=x-2 ElseIf scrollY=1 y=y+2 ElseIf scrollY=-1 y=y-2 EndIf TileImage Img$,x,y End Function ;------------------------------------
Copyright(c) 2000-2004, BlitzCoder. All Rights Reserved.
Code software created by Krylar's Kreations