Author |
Topic: Just Basic example cannot run..... (Read 109 times) |
|
kigohhere
New Member
member is offline
Posts: 11
|
|
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 » |
Logged
|
|
|
|
Rod
Full Member
member is offline
Gender:
Posts: 110
|
|
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
|
|
Logged
|
|
|
|
kigohhere
New Member
member is offline
Posts: 11
|
|
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.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
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.
|
|
Logged
|
|
|
|
|