LB Booster
« Help moving a sprite »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 05:04am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Help moving a sprite  (Read 286 times)
roytt
New Member
Image


member is offline

Avatar




PM


Posts: 2
xx Help moving a sprite
« Thread started on: Jun 17th, 2015, 06:15am »

I'm trying to use spritetravelxy to move a sprite from it's current position to the position where the mouse is clicked. All that happens is that the sprite moves to the top left of the window. Any idea what's causing this? Thanks.

Here is the program exe(4.52 mb) with embedded bmp's
https://drive.google.com/file/d/0BxI_7p6wetgmb2M5cmhUWWM2elk/view?usp=sharing

Here is the source
https://drive.google.com/file/d/0BxI_7p6wetgmdG9LYm5lMEdiNEU/view?usp=sharing
« Last Edit: Jun 17th, 2015, 06:18am by roytt » User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Help moving a sprite
« Reply #1 on: Jun 17th, 2015, 06:48am »

You are inserting variables into graphical command wrong way.
See this:
Code:
    x = 150 'MouseX
    y = 200 'MouseY
'your line - is wrong
    'print #game, "SPRITETRAVELXY ogre x y 30"
'see why
    print "Wrong:"
    print "SPRITETRAVELXY ogre x y 30"
    print "Right:"
    print "SPRITETRAVELXY ogre ";x;" ";y;" 30"
 


Output: Code:
Wrong:
SPRITETRAVELXY ogre x y 30
Right:
SPRITETRAVELXY ogre 150 200 30
 
« Last Edit: Jun 17th, 2015, 06:49am by tsh73 » User IP Logged

roytt
New Member
Image


member is offline

Avatar




PM


Posts: 2
xx Re: Help moving a sprite
« Reply #2 on: Jun 17th, 2015, 2:13pm »

thanks, that did the trick.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »


This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls