TGC Codebase Backup



sprite player 1 (fully working exe download ) by andrew pap

18th Jul 2009 20:26
Summary

helps you develop smooth animated sprites



Description


SPRITE PLAYER INTRO
FRIST TEST THE CODE WILL RUN ON THE PC
SECOND BROUSE THE DARCBASIC PRO FOLDER TO FIND TEMP FILE
THE PATH MAY LOOK LIKE "C:Program FilesThe Game CreatorsDarkBasic ProfessionalTEMP"
COPY THE FILE NAMED "dbp_program.EXE" TO MY PICTURES OR WHERE YOU PUT YOUR SPRITES
RENAME THE FILE SpritePlayer
THE WINDOW TITLE WILL SHOW WHERE IT IS GETTING THE IMAGE FROM
CONTROLES
PRESS SPACE TO UPDATE THE SPRITE PLAYER IMAGE
USE THE UP AND DOWN KEYS TO ZOOM IN AND OUT



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    REM Project: sprite player 
REM Created: 02/11/2006 09:39:07

`********** by andrew papworth-(Moon Games)
`****** set up the window
    set window on : set display mode 640,480,16
    set window size 200,200: set text transparent
    set window title "sprite player v1.0"
    set text size 41
`********* set the path to MY pictures you will need the right path
 path$ = get dir$()
set window title path$
 cd path$
enter:
`set up a back ground
box 0,0,640,480, rgb(223,223,0),rgb(223,0,a),rgb(0,223,223,),rgb(223,0,223)
`set up the sync
sync on:sync rate 60
`check to see if there is a sprite on the screen if so get rid
if sprite exist(1)=1
delete sprite 1
endif
`**** enter the sprite info
sync
    input "name of sprite - ",name$
sync
    input "frams >> across >>",acros
sync
    input "frams ^^ up ^^" , up
sync

`********** check if file exist
if file exist(name$)
  goto play:
  else :` if  the file is not in the path
  print "sorry no sprite of this name"
  print "did you add (.bmp) at the end"
  goto enter:
endif

play:
`****** make the sprite and size it up
create animated sprite 1,name$,acros,up,1
sprite 1,0,0,1

a#=123
do
`**** scale the sprite to see better
size sprite 1,a#,a#
if upkey()=1
  a#=a# + 0.5
   else
    if downkey()=1
      a#=a# - 0.5
       else
         if spacekey()=1
           goto enter:
        endif
      endif
   endif

`****** make the back ground chang
a=a+1

cls
box 0,0,640,480, rgb(a,223,0),rgb(223,0,a),rgb(0,a,223,),rgb(a,0,223)

tot= up*acros
`*********************** play the sprite
play sprite 1,1,tot,100
sync
loop
end