TGC Codebase Backup



sprite player v1.0 by andrew pap

4th Nov 2006 11:57
Summary

media not needed helps in sprite dev



Description

this program is good for making your sprite run smoother

just type in the info of the sprite if you make achang to the sprite
just press space to update the sprite. you will need to enter the sprite
info agen use the up and down key to scale sprite



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$()
 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