LB Booster
« Just Basic example cannot run..... »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:30am



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: Just Basic example cannot run.....  (Read 109 times)
kigohhere
New Member
Image


member is offline

Avatar




PM


Posts: 11
xx Just Basic example cannot run.....
« Thread started on: Jan 27th, 2018, 1:03pm »

Hi,

It is the beta version of the new version of Just Basic. I downloaded it:
http://justbasic.conforums.com/index.cgi?board=announce&action=display&num=1509542569

There are many,many examples in this package. I put many of these examples into LB Booster to run.

I discover that the following example cannot run in LB Booster. The file name of this example is SPRTTST2.bas.

Please help. Thank you.

Code:

    loadbmp "smiley1", "sprites\smiley1.bmp"
    loadbmp "smiley2", "sprites\smiley2.bmp"
    loadbmp "smiley3", "sprites\smiley3.bmp"
    loadbmp "smiley4", "sprites\smiley4.bmp"
    loadbmp "landscape", "sprites\bg1.bmp"
    WindowHeight = 300
    WindowWidth = 400
    'graphicbox #wg, 0, 0, 400, 300
    open "sprite test" for graphics_nf_nsb as #wg
    print #wg, "background landscape";
    print #wg, "addsprite smiley smiley1 smiley2 smiley3 smiley4";
    print #wg, "addsprite smiler smiley1 smiley2 smiley3 smiley4";
    print #wg, "addsprite smiled smiley1 smiley2 smiley3 smiley4";
    print #wg, "addsprite smiles smiley1 smiley2 smiley3 smiley4";
    print #wg, "cyclesprite smiley 1 once"
    print #wg, "cyclesprite smiler 1"
    print #wg, "cyclesprite smiled 1"
    print #wg, "cyclesprite smiles 1"
    for x = 1 to 100 step 2
        print #wg, "spritexy smiley "; x; " "; x
        print #wg, "spritexy smiler "; 100-x; " "; x
        print #wg, "spritexy smiled "; 100-x; " "; 100-x
        print #wg, "spritexy smiles "; x; " "; 100-x
        print #wg, "drawsprites";
        print #wg, "spritecollides smiley list$"
        if list$ > "" then print #wg, "cyclesprite smiley 1 once"
    next x

    input a$

 

« Last Edit: Jan 27th, 2018, 1:04pm by kigohhere » User IP Logged

Rod
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 110
xx Re: Just Basic example cannot run.....
« Reply #1 on: Jan 27th, 2018, 4:06pm »

It is running just really really fast. Some of the old examples did not use the timer. They were written when PCs ran a lot slower than now.

Try this.
Code:
   'Simple cycle sprite and sprite collide example
    nomainwin

    loadbmp "smiley1", "sprites\smiley1.bmp"
    loadbmp "smiley2", "sprites\smiley2.bmp"
    loadbmp "smiley3", "sprites\smiley3.bmp"
    loadbmp "smiley4", "sprites\smiley4.bmp"
    loadbmp "landscape", "sprites\bg1.bmp"
    WindowHeight = 300
    WindowWidth = 400
    'graphicbox #wg, 0, 0, 400, 300
    open "sprite test" for graphics_nf_nsb as #wg
    #wg "trapclose [quit]"

    #wg "background landscape";
    #wg "addsprite smiley smiley1 smiley2 smiley3 smiley4";
    #wg "addsprite smiler smiley1 smiley2 smiley3 smiley4";
    #wg "addsprite smiled smiley1 smiley2 smiley3 smiley4";
    #wg "addsprite smiles smiley1 smiley2 smiley3 smiley4";
    #wg "cyclesprite smiley 1 once"
    #wg "cyclesprite smiler 1"
    #wg "cyclesprite smiled 1"
    #wg "cyclesprite smiles 1"

    timer 60, [draw]

    [draw]

        #wg "spritexy smiley "; x; " "; x
        #wg "spritexy smiler "; 100-x; " "; x
        #wg "spritexy smiled "; 100-x; " "; 100-x
        #wg "spritexy smiles "; x; " "; 100-x
        #wg "drawsprites";
        #wg "spritecollides smiley list$"
        if list$ > "" then #wg "cyclesprite smiley 1 once"
    x=x+1
    if x=100 then [quit]
    wait


    [quit]
    timer 0
    close #wg
    end
 



If you follow this link there is a discussion about updating the examples and there is a link to a completely revised set of examples. The .zip is in the last post.

http://libertybasic.conforums.com/index.cgi?board=LB3&action=display&num=1501917068&start=90
User IP Logged

kigohhere
New Member
Image


member is offline

Avatar




PM


Posts: 11
xx Re: Just Basic example cannot run.....
« Reply #2 on: Jan 27th, 2018, 9:45pm »

on Jan 27th, 2018, 4:06pm, Rod wrote:
It is running just really really fast. Some of the old examples did not use the timer. They were written when PCs ran a lot slower than now.

Try this.



Hi, your code can run on my computer. Thank you.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Just Basic example cannot run.....
« Reply #3 on: Jan 27th, 2018, 10:26pm »

on Jan 27th, 2018, 4:06pm, Rod wrote:
If you follow this link there is a discussion about updating the examples and there is a link to a completely revised set of examples.

So has Carl (so far) ignored all your hard work and built the JB 2.0 beta with the old, and often less than satisfactory, examples?

Richard.
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