Pocket Burning Sand (Open Source)

colin9876

Active Member
Licensed User
Noooo,
We want it 2 work for all resolutions, landscape or portrait.

So everything on the top or the left can stay hardcoded on the form

Things to the left and bottom need to be moved RELATIVE to the sreen dimensions

SO as I said, as MaxX is always set at 30 less that the screen width

Rpanel.left=MaxX will put the right panel 30 before the edge whatever Res is on
water.left = MaxX+5 will always put the icon 5 pixels right of the Rborder
sand.left=MaxX+5
Res.Top=MaxY+10
Draw.Top=MaXY+10
Draw.Left=MaxX/2 (if u want it halfway along)

Add this code, stop the program, change ur pda to landscape or landscape and rerun it to check it looks right either way!

Sub ScreenSet
water.left = MaxX+5
sand.left=MaxX+5
Res.Top=MaxY+10
Draw.Top=MaXY+10
Draw.Left=MaxX/2
Rpanel.left=MaxX
toppanel.width =(MaxX-MinX)
lowerpanel.width=(MaX-MinY)
bottomline.width=burningsands.width 'full length for the bar at bottom of screen
etc
 
Last edited:

colin9876

Active Member
Licensed User
ok just change everything above, make sure it looks right in portrait mode & post it

You will have to adjust the amount u add to MaxX (Ive put +5) to get the pixels exactly where u want
I'll test it on a few different resolutions. If uve got it looking right in one mode it should look right on all screens because all the positions are relative to MaxX and MaxY
 

neilnapier

Active Member
Licensed User
Longtime User
OK... as I said I will try. Right now I have visitors over and it is starting to get late so I will continue on it tomorrow.
 

neilnapier

Active Member
Licensed User
Longtime User
OK, looking at it today Iget it... am doing it now.

What I am doing to test it is setting the screensize on the compiler to landscape then previewing it and then changing it.

Sorry I didn't get it till now. I'm still pretty new to these languages... the only language i ever really learned well was QBASIC and it has changed a lot since then.
 

neilnapier

Active Member
Licensed User
Longtime User
Here is the next update. It now works with all reses BUT I haven't done the sources location yet so on landcape they are still to one side... I have ran out of time but may do it tomorrow.
 

colin9876

Active Member
Licensed User
Neil, most of it good, few issues

1) playing area is minX to maxX
set rline.left=MaxX (not maxX-2)
u will have then to set
bottomline.width=(MaxX-MinX)+4
topline.width=(MaxX-MinX)+4

2) whats that variable WAT=0 uve added?

3) set the sources x coordinates of sources to
0.25*burningsands.width
0.42*
0.58*
0.75* etc

4) Can u put the letters FPS in a static label as I mentioned before, and just add the number. We should have every speed advantage we can!

Anyway there may be a way of making everything loads faster, but Ill let u know more about that when u get v6...
 
Last edited:

neilnapier

Active Member
Licensed User
Longtime User
OK... here it is! Done everthing youjust said. I am getting a licence on Xmas Day so isn't long until I might be allowed to get Beta.

EDIT: I just found a glitch in the FPS thing... forogt to add one of the lefts, will repost it in a couple of minutes.

EDIT: Here is it sorted.
 
Last edited:

colin9876

Active Member
Licensed User
good progress

looks good
I get a bug sometimes on the PC when it stops drawing fixed walls etc. Have u had that?
 
Last edited:

neilnapier

Active Member
Licensed User
Longtime User
I will post on the front page when V3 is released.

How are you coming along with the reactions? Has AGraham answered you yet?

I haven't seen that yet no... but I haven't tried the last realese.

EDIT: When I load this I get the keyboard menu appearing at the bottom covering up the FPS draw and res. Is there a way to get rid of that.

EDIT2: Do you mean that when you are drawing wit a line then sometimes circles appear of you click wall... cause that happens to me.
 
Last edited:

colin9876

Active Member
Licensed User
Yes basically I said to AG that I wanted to be able to adjust the library. I had been trying to cram the c# code into the midway C file produced by v6, but he said it would be much better to download SharpDevelopment or something and do it properly.

Have u got Visual Sudio 2005 - its free I believe. Im just going to google this SharpDevelopment.
We need that so I can put the rules code into the library

Edit- an u do me a favour and find the C code for MicroBurningSand, its only 10lines of C and its posted on the BS website somewhere. Then can u post it here - I want to look at it?
 
Last edited:

neilnapier

Active Member
Licensed User
Longtime User
When you say that the libraries don't get any faster do yo umean that the FPS aren't any faster in the new BASIC.

Also didn't he say that you can't make dlls for PPC with the studio. Yes I belive I have it somewhere.
 

neilnapier

Active Member
Licensed User
Longtime User
Here is microsand.

EDIT: oops wrong one.

B4X:
#include <SDL/SDL.h> 
int main(int,char**){SDL_Surface*s=SDL_SetVideoMode(640,480,8,0);SDL_Event e; 
int r,u,x,y,a=-1,b,h=s->h,z=s->pitch,q[]={0,r=91,u=140,200};Uint8*o,*p=(Uint8*) 
s->pixels+z;SDL_WM_SetCaption("MicroSand 2 by Max Nagl",0);while(!SDL_Flip(s)) 
{for(x=0;++x<s->w;p[x-z]=p[(h-2)*z+x]=1);for(o=p+(h-2)*z;--o>p;){if(*o-200)if 
((*o>(b=*(o+z)))&&((r*=5)%((*o-b)/5+2)>5)){*(o+z)=*o;*o=b-1?b:0;}else if((b=*o) 
>*(o+(y=1))&&((r*=7)%97)>1||b>*(o+(y=a))){*o=*(o+y);*(o+y)=b-1?b:0;}}while( 
SDL_PollEvent(&e)){switch(e.type){case 2:u=q[e.key.keysym.sym%4];break;case 12: 
return 0;case 4:case 5:SDL_MouseMotionEvent m=e.motion;for(y=m.y-9;y++<m.y+9&& 
m.state;)for(x=m.x-9;x++<m.x+9;)if((x>a)*(x<s->w)*(y>a)*(y<h))p[y*z+x]=u;}}}}
 
Last edited:

colin9876

Active Member
Licensed User
number crunching

Thanks - thing is we need C for some of this because basic uses strings to store variables. So numbers like px,py,pcolor etc all get changed to strings and back again and thats delay we cant afford.
We need fast number crunching for the main engine loop

Ive just downloaded SharpDevelop. Its free. U get it too? Lets have a pay around with it and chat in a day or so.
 

neilnapier

Active Member
Licensed User
Longtime User
Don't you think it would help if I knew any C coding whatsoever?

If you give me the coding I will download it and use it as long as it has a decent understandable UI.

I have only ever used the basic languages and I am sure they are very different by looking at comparisons on the net.

Sometimes the line and circle pen changes after clicking on liquids to solids.

EDIT: how did you get it if it is for desktop comuters only?
 

colin9876

Active Member
Licensed User
Theres a laptop I can use, still its not easy as a) Vista annoys me & b)I have to use my phone as a modem and it downloads at about 1k a minute. This Sharp thing is over 8Megs, it may take me all night!
 

neilnapier

Active Member
Licensed User
Longtime User
Has it downloaded yet... lol?

Also just to give you some information about things that, once MiniBS is complete, can still be worked on. There is bias in BS which causes things to expand at different speeds. BS updates from top to bottom and therefore never makes a pefecrt expanding circle.

Also a glitch that has been noticed on many sand games that are in early stages is that when something like
B4X:
Interaction Fish Water Water Fish 1000
is written then the fish have bias so that they fall to the bottom or rise to the top but instead they should split up in many different directions.
 
Last edited:

colin9876

Active Member
Licensed User
no, it didnt download properly but I had more luck with C# express 2008 but that doesnt allow dlls
Also I downloaded VisualBasic2008, its actually quite fast but Microsoft have managed to make that more complicated than VB6, u have to define a graphics class to just draw a line! Basic4ppc is definately more user firendly.

I watched some youtube videos yesterday, carbombs, burning Homer, electricity generator ... I can see now all the things that can be done by mods.

Anyway need to sort out how to rewrite this lib, I realise now there are some more speed increases possible but I need to be able to adjust the C#
 
Last edited:

neilnapier

Active Member
Licensed User
Longtime User
Merry Xmas everyone!!! Tomorrow I should be getting a BASIC4PPC licence.

How would it be possible to load and save sandboxes?

That thing that I used before to save it worked but the images weren't loadable on a PPC. We could load the image into the fore or background easily but getting liquids and gases to move might be difficult.
 
Top