Bomberman in xlib
Moderator: MaxCoderz Staff
-
- Sir Posts-A-Lot
- Posts: 252
- Joined: Tue 09 Aug, 2005 9:34 pm
- Location: south of the north pole
- Contact:
Bomberman in xlib
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
-
- Calc King
- Posts: 2195
- Joined: Sun 27 Mar, 2005 4:06 am
- Location: sleeping
- Contact:
are you using a matrix for the map, if so, do what necro said
hm i didnt really explain that well. if you dont get it, try me tomorrow when im coherent.
Code: Select all
[A](x,y)->B
if b(doesnotequal)0
then
go back to pos before
end
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......
Last edited by crzyrbl on Tue 16 Aug, 2005 6:09 am, edited 1 time in total.
-
- Calc King
- Posts: 2195
- Joined: Sun 27 Mar, 2005 4:06 am
- Location: sleeping
- Contact:
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.
Last edited by threefingeredguy on Tue 16 Aug, 2005 6:11 am, edited 1 time in total.
i use x,y in basic...
y 1 16
x
1
8
y 1 16
x
1
8
Last edited by crzyrbl on Tue 16 Aug, 2005 6:44 am, edited 1 time in total.
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/rowcrzyrbl 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......
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)
-
- Calc King
- Posts: 2195
- Joined: Sun 27 Mar, 2005 4:06 am
- Location: sleeping
- Contact:
-
- Calc Wizard
- Posts: 526
- Joined: Tue 08 Mar, 2005 1:37 am
- Location: who wants to know?
- Contact:
Won't work. When A is 0, you end up using X and Y twice, what you should do isgetkey->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
(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...DarkerLine wrote:Won't work. When A is 0, you end up using X and Y twice, what you should do isgetkey->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
(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.
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
-
- Calc Wizard
- Posts: 526
- Joined: Tue 08 Mar, 2005 1:37 am
- Location: who wants to know?
- Contact: