Page 1 of 5

Bomberman in xlib

Posted: Tue 16 Aug, 2005 3:00 am
by katmaster
i just started making a bomberman in xlib. i would put up some screens but i cant figure out how to post them to the web. its my first real game for 83+ and any suggestions or ideas would be nice

Posted: Tue 16 Aug, 2005 3:05 am
by crzyrbl
good luck, and never use the bottom 8 pixels for sprites. i did that once :x ask if you nd any help :P

Posted: Tue 16 Aug, 2005 5:20 am
by katmaster
ok heres a screen of lvl 1. yah. im still working on movement and if all goes well, should be done tommorow. im not sure how to make sure he cant go though walls yet. any suggestions?

Image

Posted: Tue 16 Aug, 2005 5:35 am
by necro
check using the [A](Column,row)->Variable to find out if what your character is moving into is a wall, open air, a bomb, ect. and if neede, prevent him from moving though it

Posted: Tue 16 Aug, 2005 5:59 am
by threefingeredguy
are you using a matrix for the map, if so, do what necro said

Code: Select all

[A](x,y)->B
if b(doesnotequal)0
then
go back to pos before
end
hm i didnt really explain that well. if you dont get it, try me tomorrow when im coherent.

Posted: Tue 16 Aug, 2005 6:05 am
by necro
in basic, the matrices go y,x as opposed to x,y...a source of many errors I have recieved over the time I have been programming[/quote]

Posted: Tue 16 Aug, 2005 6:07 am
by crzyrbl
or better yet...

Code: Select all

........your code......
getkey->K
X+(K=34)-(K=25->A
Y+(K=26)-(K=24->B
if 0 = [A](A,B
then
A->X
B->Y
end
.......your code......

Posted: Tue 16 Aug, 2005 6:09 am
by threefingeredguy
bahleted cause what i wrote is now obselete. and i response to the post below (wierd) i avoid x and y cause they can get messed up by the graph screen. i use z and theta.

Posted: Tue 16 Aug, 2005 6:10 am
by crzyrbl
i use x,y in basic...
y 1 16
x
1



8

Posted: Tue 16 Aug, 2005 6:44 am
by necro
crzyrbl wrote:or better yet...

Code: Select all

........your code......
getkey->K
X+(K=34)-(K=25->A
Y+(K=26)-(K=24->B
if 0 = [A](A,B
then
A->X
B->Y
end
.......your code......
if he is using xlib app, and he used your code, his map would be read at a 90 degree difrent form what the screen would show because Xlib reads row/column but the matrice comands are column/row


getkey->K
X+(K=34)-(K=25->A
Y+(K=26)-(K=24->B
0=[A](B,A->C
X+A(C->X
Y+B(C->Y

by the way, that is bigger but I believe it is faster (wish there was some kind of definative way to clock a routine in a basic program)

Posted: Tue 16 Aug, 2005 3:07 pm
by threefingeredguy
put a pause at the beginning of the routine and a Pause "Done" at the end and time it on a stop watch.

Posted: Tue 16 Aug, 2005 3:55 pm
by DarkerLine
getkey->K
X+(K=34)-(K=25->A
Y+(K=26)-(K=24->B
0=[A](B,A->C
X+A(C->X
Y+B(C->Y
Won't work. When A is 0, you end up using X and Y twice, what you should do is
(K=34)-(K=25->A
(K=26)-(K=24->B
not([A](Y+B,X+A->C
X+AC->X
Y+BC->Y

And keep in mind that this works in the generic situation, but there will probably be a way to optimize this given the code around it.

Posted: Tue 16 Aug, 2005 4:06 pm
by katmaster
i didnt use the tilemap thing on it due to the fact i dont totally understand how how the matrices work with it. is it like: 0=dont draw and 1=draw tile or what?

Posted: Tue 16 Aug, 2005 4:14 pm
by necro
DarkerLine wrote:
getkey->K
X+(K=34)-(K=25->A
Y+(K=26)-(K=24->B
0=[A](B,A->C
X+A(C->X
Y+B(C->Y
Won't work. When A is 0, you end up using X and Y twice, what you should do is
(K=34)-(K=25->A
(K=26)-(K=24->B
not([A](Y+B,X+A->C
X+AC->X
Y+BC->Y

And keep in mind that this works in the generic situation, but there will probably be a way to optimize this given the code around it.
yeah, little mess up...and the code executes to fast to time it with a watch very well...I suppose I could try to run two pindurs and start them simulataneously (via virtual link) and see which is faster that way...

and katmaster, a matrice is where you store the tile map info for Xlib...it has columns that go up and down, and rows across. You 'ask' the player (via Getkey) if they would like to move a direction (which it sounds like you allready have done) and you can check the matrice (wich the data to draw your screen) to see what variable you character will move onto, and prevent him from walking through walls...so, player signals character to move, you check matrice, if the matrice has a wall where your char is moving, he doesn't move

Posted: Tue 16 Aug, 2005 4:44 pm
by DarkerLine
Sir Robin a.k.a. DarkerLine's ULTIMATE 1337 TI-Basic Comparison Timer

Disp "Timing Routine 1
For(I,1,1000
FOO
End
Pause "Routine 1 Ended
Disp "Timing Routine 2
For(I,1,1000
BAR
End
"Routine 2 Ended


Get yourself a stopwatch.

P.S. There's no such thing as a 'matrice'. It's called a matrix.