MausBoy Posted April 18, 2006 Share Posted April 18, 2006 (edited) This looks pretty bad but it was fun to see what my 2600 version of him would be like. There is nothing super about this code or the sprite, but if you can do something interesting with this code and repost it that would be great. Also if anyone just has time to clean it up and repost it, it would help to see how I can stop being so sloppy with code. 1 pfclear : goto title 3 pfclear : x = 30 : y = 10 : v = 38 : w = 10 : k = 5 : p = 0 a = 0 : b = 0 : c = 0 : d = 0 : e = 0 : pfhline 0 10 31 on : pfhline 22 5 31 on : pfhline 10 10 18 off 6 player0: %00001111 %00001111 %00010011 %00010001 %00111111 %00111111 %00011111 %00001100 %00011000 %00100110 %00100110 %00011100 %00011111 %00001111 %00000111 %00000000 end player1: %11100000 %11100000 %11110000 %10110000 %11110000 %11110000 %11100000 %00010000 %11111000 %01000100 %10000100 %10111000 %11111100 %11111000 %11100000 %00000000 end goto 15 10 player0: %00001110 %00011111 %00011111 %00001111 %00010011 %00100011 %00011111 %00000111 %00000110 %00001001 %00001001 %00000111 %00000111 %00000011 %00000001 end player1: %00011000 %00111100 %11111110 %11111110 %11010101 %11111101 %11111110 %10000100 %00111110 %10010001 %10100001 %00101110 %11111111 %11111110 %11110000 end 15 player0x = x : player0y = y : player1x = v player1y = w : COLUP0 = 1 : COLUP1 = 1 COLUBK = 15 : COLUPF = 7 : CTRLPF = $31 if collision(player0, playfield) then a = 8 : goto 17 if collision(player1, playfield) then a = 8 : goto 17 16 if a = 5 then goto 17 if a = 6 then goto 17 if a = 0 then y = y + 1 : w = w + 1 17 drawscreen if joy0fire && a = 8 then a = 5 if c = 5 then goto 18 if joy0right && k = 5 then x = x + 1 : v = v + 1 : d = d + 1 else e = e + 1 if joy0right && k = 2 then v = v + 16 : k = 5 if k = 5 then REFP0 = 0 : REFP1 = 0 if joy0left && k = 2 then x = x - 1 : v = v - 1 : d = d + 1 : e = e - 1 if joy0left && k = 5 then v = v - 16 : k = 2 18 if a = 5 then y = y - 2 : w = w - 2 : b = b + 1 if b > 25 then a = 6 : b = 0 if a = 6 then y = y + 2 : w = w + 2 if k = 2 then REFP0 = 8 : REFP1 = 8 if joy0right && x > 110 then p = p + 1 if p > 6 then pfscroll left : p = 0 if x > 140 then x = 140 : v = 148 if v < 30 then v = 30 : x = 38 if d > 12 then d = 0 if joy0down && a = 8 then c = 5 : goto 30 else c = 0 if y < 3 then y = 3 : w = 3 if y > 86 then goto 1 19 if switchbw then goto 19 if a = 5 || a = 6 then goto 20 if e > 8 then e = 0 : d = 0 : goto 6 if d < 6 then goto 6 if d > 5 then goto 10 goto 6 20 player0: %01101110 %11111111 %11111111 %01111111 %10001111 %10001111 %01111111 %00111111 %00001100 %00011000 %00100110 %00100110 %00011100 %00011111 %00001111 %00000111 end player1: %00000000 %10001100 %11111110 %11111110 %11111111 %10110111 %11111110 %11111000 %00001100 %11111110 %01000110 %10000110 %10000110 %10111001 %11110001 %11001110 end goto 15 30 player0: %01111111 %11111111 %11111111 %01111111 %00110011 %01111100 %01111000 %01111000 %01111100 %00111111 %00011111 %00001111 %00000000 %00000000 %00000000 %00000000 end player1: %10000000 %11000000 %11000000 %10000000 %11100000 %10010000 %01010000 %01100000 %11100000 %11110000 %11000000 %00000000 %00000000 %00000000 %00000000 %00000000 end goto 15 title a = 0 pfpixel 0 0 on : pfpixel 1 0 on : pfpixel 4 0 on : pfpixel 5 0 on pfpixel 6 0 on : pfpixel 11 0 on : pfpixel 20 0 on : pfpixel 25 0 on pfpixel 26 0 on : pfpixel 27 0 on : pfpixel 30 0 on : pfpixel 31 0 on pfpixel 0 1 on : pfpixel 3 1 on : pfpixel 7 1 on : pfpixel 10 1 on pfpixel 12 1 on : pfpixel 13 1 on : pfpixel 14 1 on : pfpixel 15 1 on pfpixel 16 1 on : pfpixel 17 1 on : pfpixel 18 1 on : pfpixel 19 1 on pfpixel 21 1 on : pfpixel 24 1 on : pfpixel 28 1 on : pfpixel 31 1 on pfpixel 2 2 on : pfpixel 3 2 on : pfpixel 4 2 on : pfpixel 5 2 on pfpixel 6 2 on : pfpixel 7 2 on : pfpixel 8 2 on : pfpixel 9 2 on pfpixel 11 2 on : pfpixel 12 2 on : pfpixel 19 2 on : pfpixel 20 2 on pfpixel 22 2 on : pfpixel 23 2 on : pfpixel 24 2 on : pfpixel 25 2 on pfpixel 26 2 on : pfpixel 27 2 on : pfpixel 28 2 on : pfpixel 29 2 on pfpixel 1 3 on : pfpixel 5 3 on : pfpixel 8 3 on : pfpixel 10 3 on pfpixel 11 3 on : pfpixel 14 3 on : pfpixel 16 3 on : pfpixel 17 3 on pfpixel 20 3 on : pfpixel 21 3 on : pfpixel 23 3 on : pfpixel 26 3 on pfpixel 30 3 on : pfpixel 0 4 on : pfpixel 1 4 on : pfpixel 2 4 on pfpixel 3 4 on : pfpixel 4 4 on : pfpixel 5 4 on : pfpixel 6 4 on pfpixel 7 4 on : pfpixel 9 4 on : pfpixel 10 4 on : pfpixel 13 4 on pfpixel 15 4 on : pfpixel 17 4 on : pfpixel 18 4 on : pfpixel 21 4 on pfpixel 22 4 on : pfpixel 24 4 on : pfpixel 25 4 on : pfpixel 26 4 on pfpixel 27 4 on : pfpixel 28 4 on : pfpixel 29 4 on : pfpixel 30 4 on pfpixel 31 4 on : pfpixel 0 5 on : pfpixel 4 5 on : pfpixel 7 5 on pfpixel 9 5 on : pfpixel 10 5 on : pfpixel 13 5 on : pfpixel 15 5 on pfpixel 17 5 on : pfpixel 18 5 on : pfpixel 21 5 on : pfpixel 22 5 on pfpixel 24 5 on : pfpixel 27 5 on : pfpixel 31 5 on : pfpixel 1 6 on pfpixel 2 6 on : pfpixel 3 6 on : pfpixel 4 6 on : pfpixel 5 6 on pfpixel 6 6 on : pfpixel 7 6 on : pfpixel 8 6 on : pfpixel 10 6 on pfpixel 11 6 on : pfpixel 13 6 on : pfpixel 17 6 on : pfpixel 18 6 on pfpixel 20 6 on : pfpixel 21 6 on : pfpixel 23 6 on : pfpixel 24 6 on pfpixel 25 6 on : pfpixel 26 6 on : pfpixel 27 6 on : pfpixel 28 6 on pfpixel 29 6 on : pfpixel 30 6 on : pfpixel 2 7 on : pfpixel 6 7 on pfpixel 9 7 on : pfpixel 11 7 on : pfpixel 12 7 on : pfpixel 19 7 on pfpixel 20 7 on : pfpixel 22 7 on : pfpixel 25 7 on : pfpixel 29 7 on pfpixel 0 8 on : pfpixel 3 8 on : pfpixel 7 8 on : pfpixel 10 8 on pfpixel 12 8 on : pfpixel 13 8 on : pfpixel 14 8 on : pfpixel 15 8 on pfpixel 16 8 on : pfpixel 17 8 on : pfpixel 18 8 on : pfpixel 19 8 on pfpixel 21 8 on : pfpixel 24 8 on : pfpixel 28 8 on : pfpixel 31 8 on pfpixel 0 9 on : pfpixel 1 9 on : pfpixel 4 9 on : pfpixel 5 9 on pfpixel 6 9 on : pfpixel 11 9 on : pfpixel 20 9 on : pfpixel 25 9 on pfpixel 26 9 on : pfpixel 27 9 on : pfpixel 30 9 on : pfpixel 31 9 on pfpixel 0 10 on : pfpixel 1 10 on : pfpixel 2 10 on : pfpixel 8 10 on pfpixel 9 10 on : pfpixel 14 10 on : pfpixel 15 10 on : pfpixel 16 10 on pfpixel 17 10 on : pfpixel 22 10 on : pfpixel 23 10 on : pfpixel 29 10 on pfpixel 30 10 on : pfpixel 31 10 on titleb COLUPF = 44 : COLUBK = 4 : COLUP0 = 4 : COLUP1 = 4 drawscreen if joy0fire then a = a + 1 if a > 15 then goto 3 else goto titleb matario.bin Edited April 18, 2006 by MausBoy Quote Link to comment Share on other sites More sharing options...
Shawn Posted April 18, 2006 Share Posted April 18, 2006 (edited) OMG!!! PLEASE , PLEASE MAKE A GAME OUT OF THIS!!! Even if its just a few levels, I don't care. This is awsome Just check out the screen shots I attached!! This is gold!! Edited April 18, 2006 by Shawn Sr. Quote Link to comment Share on other sites More sharing options...
badbrad Posted April 18, 2006 Share Posted April 18, 2006 Wow, that looks really good. I like it. Quote Link to comment Share on other sites More sharing options...
Gregory DG Posted April 18, 2006 Share Posted April 18, 2006 Nice! And hey... if the 2600 could do a SMB game, surely the 7800 could. Quote Link to comment Share on other sites More sharing options...
Jess Ragan Posted April 18, 2006 Share Posted April 18, 2006 I'd recommend making a game based on the Super Mario Bros. Game & Watch that debuted just before the original Game Boy was released. I think the 2600 should be able to handle that, and even make it better by giving you more control over Mario. JR Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted April 18, 2006 Share Posted April 18, 2006 Very nice looking! But...looks like you are using both sprites for Mario, which doesn't leave much for anything else. Quote Link to comment Share on other sites More sharing options...
MausBoy Posted April 18, 2006 Author Share Posted April 18, 2006 I'd recommend making a game based on the Super Mario Bros. Game & Watch that debuted just before the original Game Boy was released. I think the 2600 should be able to handle that, and even make it better by giving you more control over Mario.JR The first words out of my mouth when I compiled this and ran it were Game & Watch. I don't have that one though so it'd be hard for me to remake it. So far Mario can run, jump, duck, and shoot fireballs in my version, I'm just hoping someone will repost this with a better jump routine and we'll have most of the controls from smb1. No vines yet though. Quote Link to comment Share on other sites More sharing options...
+Atarius Maximus Posted April 18, 2006 Share Posted April 18, 2006 (edited) Very nice looking! But...looks like you are using both sprites for Mario, which doesn't leave much for anything else. There's always the multisprite kernel. Also if anyone just has time to clean it up and repost it, it would help to see how I can stop being so sloppy with code. This is pretty cool, MausBoy. I was very interested in how you implemented mATARIo's movement and jumping, as I was having a little difficulty with that in my jumpman demo - sometimes a little sample code goes a long way. I went through your code and commented everything to get a better idea of how you made it work. The title screen part was removed, I was planning on re-doing that with data tables, but I'm out of time today to work on this. Below is the updated code, sans the title screen. I'm also not a big fan of using line numbers, so I changed that in the code as well. rem +-----------------------------------------+ rem | mATARIo Demo | 2120 bytes free | rem | for batariBasic | | rem | by MausBoy | | rem +-----------------------------------------+ rem | Commented & Modified| tested with | rem | by Atarius Maximus | bB v.99b | rem | v0.01 (4/18/2006) | | rem +-----------------------------------------+ set romsize 4k init pfclear rem -------------------- rem Initialize Variables rem -------------------- x=30 : rem player0 X Position y=10 : rem player0 Y Position v=38 : rem player1 X Position w=10 : rem Player1 Y Position k=5 : rem sprite reflection flag p=0 : rem Scroll Counter a=0 : rem Player Vertical Position flag b=0 : rem Jump Height c=0 : rem Player Crouching flag d=0 : rem sprite definition e=0 : rem framecounter rem ----------------------------- rem Draw playfield rem ----------------------------- rem rem ////Bottom Platform//// rem pfhline 0 10 31 on rem rem ////Top Platform//// rem pfhline 22 5 31 on : pfhline 10 10 18 off standing rem ------------------------------ rem Define Sprite - Standing Still rem ------------------------------ rem ....XXXXXXX..... rem ....XXXXXXX..... rem ...X..XXXXXX.... rem ...X..XXX.XX.... rem ..XXXXXXXXXX.... rem ..XXXXXXXXXX.... rem ...XXXXXXXX..... rem ....XX.....X.... rem ...XX...XXXXX... rem ..X..XX..X...X.. rem ..X..XX.X....X.. rem ...XXX..X.XXX... rem ...XXXXXXXXXXX.. rem ....XXXXXXXXX... rem .....XXXXXX..... rem ................ player0: %00001111 %00001111 %00010011 %00010001 %00111111 %00111111 %00011111 %00001100 %00011000 %00100110 %00100110 %00011100 %00011111 %00001111 %00000111 %00000000 end player1: %11100000 %11100000 %11110000 %10110000 %11110000 %11110000 %11100000 %00010000 %11111000 %01000100 %10000100 %10111000 %11111100 %11111000 %11100000 %00000000 end goto main running rem ------------------------------ rem Define Sprite - Running rem ------------------------------ rem ....XXX....XX... rem ...XXXXX..XXXX.. rem ...XXXXXXXXXXXX. rem ....XXXXXXXXXXX. rem ...X..XXXX.X.X.X rem ..X...XXXXXXXX.X rem ...XXXXXXXXXXXX. rem .....XXXX....X.. rem .....XX...XXXXX. rem ....X..XX..X...X rem ....X..XX.X....X rem .....XXX..X.XXX. rem .....XXXXXXXXXXX rem ......XXXXXXXXX. rem .......XXXXX.... player0: %00001110 %00011111 %00011111 %00001111 %00010011 %00100011 %00011111 %00000111 %00000110 %00001001 %00001001 %00000111 %00000111 %00000011 %00000001 end player1: %00011000 %00111100 %11111110 %11111110 %11010101 %11111101 %11111110 %10000100 %00111110 %10010001 %10100001 %00101110 %11111111 %11111110 %11110000 end rem ------------------------------ rem Main Loop rem ------------------------------ main rem ------------------------------ rem Define Player X,Y Positions rem ------------------------------ player0x = x player0y = y player1x = v player1y = w rem ------------------------------ rem Define Colors & Playfield rem ------------------------------ COLUP0 = 1 COLUP1 = 1 COLUBK = 15 COLUPF = 7 CTRLPF = $31 rem ------------------------------ rem Collision Detection rem ------------------------------ rem rem if player is touching at platform, A=8 rem if collision(player0, playfield) then a = 8 : goto gp1 if collision(player1, playfield) then a = 8 : goto gp1 rem rem if a is 5 or 6, player is jumping rem if a = 5 then goto gp1 if a = 6 then goto gp1 if a = 0 then y = y + 1 : w = w + 1 : rem move mario up one on the Y Axis gp1 drawscreen rem ------------------------------ rem Detect Button Press rem ------------------------------ rem rem if mario's touching a platform, and the button is pressed, then A=5 rem rem Note: later in the code, when A=5, decrease player's Y value by 2 and rem increment variable B by 1. rem if joy0fire && a = 8 then a = 5 rem ------------------------------ rem Detect Player Crouch rem ------------------------------ rem rem Detect if matario is crouching. If so, skip over left/right movement detection. rem if c = 5 then goto gp2 rem ------------------------------ rem Notes rem ------------------------------ rem ** note: K's initial value is 5. It represents the direction mario is facing. rem ** 5=right, 2=left rem ------------------------------ rem Left/Right Player Movement rem ------------------------------ rem rem ////Right//// rem rem if joystick pressed right, and mario is facing right(k=5), then rem Increment X,V (Player's X Position) by 1 rem Increment D by 1 (if d<6 then standing still sprite) (if d>5 then running sprite) rem Increment E by 1 if pressing right on the joystick and player is facing right. rem if joy0right && k = 5 then x = x + 1 : v = v + 1 : d = d + 1 else e = e + 1 rem rem If joystick movement is changed from right to left, then rem Increment v by 16 (to maintain proper sprite reflection) rem Change value of K to 5, to indicate change of direction to right rem if joy0right && k = 2 then v = v + 16 : k = 5 rem rem Sprite Reflection rem If Player is facing right, do not reflect the sprites. rem if k = 5 then REFP0=0 : REFP1=0 rem rem ////Left//// rem rem if joystick pressed left, and mario is facing left (k=2), then rem Decrement X,V (Player's X Position) by 1 rem Increment D by 1 (if d<6 then standing still sprite) (if d>5 then running sprite) rem Decrement E by 1 if pressing left on the joystick and player is facing left rem if joy0left && k = 2 then x = x - 1 : v = v - 1 : d = d + 1 : e = e - 1 rem rem If joystick movement is changed from left to right, then rem Decrement v by 16 (to maintain proper sprite reflection) rem Change value of K to 2, to indicate change of direction to left rem if joy0left && k = 5 then v = v - 16 : k = 2 gp2 rem ------------------------------ rem Player Jump Routine rem ------------------------------ rem rem If a=5, player is jumping (button has been pressed), then rem Decrement Y,W by 2 (This will cause player to jump up) rem Increment B by 1 (Jump Height Meter) rem if a = 5 then y = y - 2 : w = w - 2 : b = b + 1 rem rem ////Jump Height Meter//// rem rem if the b framecounter is greater than 25, then a = 6, which will bring mario back down rem in the code a few lines down. Meter is also reset to 0. rem if b > 25 then a = 6 : b = 0 rem rem A will equal 6 when the Jump Height meter has been reached. Bring player back down to earth. rem Decrement Y,W by 2 (Player Y Position) rem if a = 6 then y = y + 2 : w = w + 2 rem rem if K=2, player is facing left, reflect sprite rem if k = 2 then REFP0 = 8 : REFP1 = 8 rem ------------------------------ rem Scrolling/Game Boundaries rem ------------------------------ rem rem ////Scroll//// rem rem if player is pushing right on the stick at the right edge of the field, rem then increment P by 1 rem if joy0right && x > 110 then p = p + 1 rem rem if p is greater than 6, then scroll to the right and reset to 0 rem if p is not reset to 0, the scroll speed will be very fast! rem if p > 6 then pfscroll left : p = 0 rem rem ////Boundaries//// rem rem Change sprite positions when the right edge of the screen is reached. rem if x > 140 then x = 140 : v = 148 rem rem Change sprite positions when the left edge of the screen is reached. rem if v < 30 then v = 30 : x = 38 rem rem Reset sprite definition variable to 0 rem if d > 12 then d = 0 rem rem if you push down on the joystick while standing on a platform, mario will crouch (jump to crouching). rem if joy0down && a = 8 then c = 5 : goto crouching else c = 0 rem rem Mario has reached the top of the screen. rem if y < 3 then y = 3 : w = 3 rem rem if y > 86, restart game rem if y > 86 then goto init rem ------------------------------ rem Detect B/W Switch - Pause Game rem ------------------------------ rem bws if switchbw then goto bws rem rem ------------------------------ rem Set Sprite Definitions rem ------------------------------ rem rem if A is 5 or 6, set sprite definition to the 'jumping' sprite. rem if a = 5 || a = 6 then goto jumping rem rem E counter is to make sure mario returns to standing after walking/running rem if e > 8 then e = 0 : d = 0 : goto standing : rem jump to standing sprite rem rem if d is 5 or less, set sprite definition to 'standing' sprite. rem if d < 6 then goto standing rem rem if d is 6 or more, set sprite definition to 'running' sprite. rem if d > 5 then goto running goto standing jumping rem ------------------------------ rem Define Sprite - Jumping rem ------------------------------ rem .XX.XXX......... rem XXXXXXXXX...XX.. rem XXXXXXXXXXXXXXX. rem .XXXXXXXXXXXXXX. rem X...XXXXXXXXXXXX rem X...XXXXX.XX.XXX rem .XXXXXXXXXXXXXX. rem ..XXXXXXXXXXX... rem ....XX......XX.. rem ...XX...XXXXXXX. rem ..X..XX..X...XX. rem ..X..XX.X....XX. rem ...XXX..X....XX. rem ...XXXXXX.XXX..X rem ....XXXXXXXX...X rem .....XXXXX..XXX. player0: %01101110 %11111111 %11111111 %01111111 %10001111 %10001111 %01111111 %00111111 %00001100 %00011000 %00100110 %00100110 %00011100 %00011111 %00001111 %00000111 end player1: %00000000 %10001100 %11111110 %11111110 %11111111 %10110111 %11111110 %11111000 %00001100 %11111110 %01000110 %10000110 %10000110 %10111001 %11110001 %11001110 end goto main crouching rem ------------------------------ rem Define Sprite - Crouching rem ------------------------------ rem .XXXXXXXX....... rem XXXXXXXXXX...... rem XXXXXXXXXX...... rem .XXXXXXXX....... rem ..XX..XXXXX..... rem .XXXXX..X..X.... rem .XXXX....X.X.... rem .XXXX....XX..... rem .XXXXX..XXX..... rem ..XXXXXXXXXX.... rem ...XXXXXXX...... rem ....XXXXXX...... rem ................ rem ................ rem ................ rem ................ player0: %01111111 %11111111 %11111111 %01111111 %00110011 %01111100 %01111000 %01111000 %01111100 %00111111 %00011111 %00001111 %00000000 %00000000 %00000000 %00000000 end player1: %10000000 %11000000 %11000000 %10000000 %11100000 %10010000 %01010000 %01100000 %11100000 %11110000 %11000000 %00000000 %00000000 %00000000 %00000000 %00000000 end goto main theend COLUPF = 44 COLUBK = 4 COLUP0 = 4 COLUP1 = 4 drawscreen if joy0fire then a = a + 1 if a>15 then goto init else goto theend Edited April 18, 2006 by Atarius Maximus Quote Link to comment Share on other sites More sharing options...
MausBoy Posted April 18, 2006 Author Share Posted April 18, 2006 Very nice looking! But...looks like you are using both sprites for Mario, which doesn't leave much for anything else. You can't have a good Mario with one unless you want DK mario. This beats the first version, it flickered player0 to make a flying-only Racoon Mario. I could do enemies with playfield pixels if I could figure out the multisprite kernel, but it won't work for me. I use one missile for fireballs and flicker player0/1 for fireflowers, the other missile is for coins. They are blockey but they do at least spin and the sound of picking one up is close. I don't know how far this game will go because I don't know how to program decent collision detection. Quote Link to comment Share on other sites More sharing options...
MausBoy Posted April 18, 2006 Author Share Posted April 18, 2006 This is pretty cool, MausBoy. I was very interested in how you implemented mATARIo's movement and jumping, as I was having a little difficulty with that in my jumpman demo - sometimes a little sample code goes a long way. I went through your code and commented everything to get a better idea of how you made it work. The title screen part was removed, I was planning on re-doing that with data tables, but I'm out of time today to work on this. Below is the updated code, sans the title screen. I'm also not a big fan of using line numbers, so I changed that in the code as well. Thanks for the much easier to read commented code AM, I'm using it to update the game. The way it's setup now isn't good for much because of the lack of collision detection but there is plenty of room for improvements. The only things I noticed in your comments are the E counter is to make sure mario returns to standing after walking/running, and Y=3 means mario has reached the top of the screen. I've added a "mario dies" sequence, lives, coins, running, and fireballs/flowers. I'm working on pipes, vines, goombas, koopa troopers and better collision detection with math. Almost anytime mario touches anything now the game branches to a sub to find out what he's touching and where. Quote Link to comment Share on other sites More sharing options...
+Atarius Maximus Posted April 18, 2006 Share Posted April 18, 2006 (edited) Thanks for the much easier to read commented code AM, I'm using it to update the game. You're welcome, I'm glad it helped. The only things I noticed in your comments are the E counter is to make sure mario returns to standing after walking/running, and Y=3 means mario has reached the top of the screen. Yeah, I ran through the commenting process pretty quickly this morning. The Y=3 should have been obvious, but that was one of the last comments I made in the code before posting it. The E variable I actually wasn't sure about...it's not as easy as you might think reverse engineering code that someone else wrote. I updated my previous post to reflect those errors. Keep up the good work, this looks very promising. If I figure anything else out with collision detection in my own demo, I'll share the code with you. Steve Edited April 18, 2006 by Atarius Maximus Quote Link to comment Share on other sites More sharing options...
MausBoy Posted April 18, 2006 Author Share Posted April 18, 2006 (edited) Good collision detection would help a lot. mario needs to bounce back down if he jumps up and hits a platform, he needs to be able to run into walls, and walk off the edge of platforms, stomp on enemies, etc. I could do a lot of that with checking to see if specific playfield pixels are on or off, but i dont know how to do the math to compare sprite location values to playfield pixel locations. If I get this worked out, I can add a few levels in. I've added in swimming mario for future use too I know it's hard to comment someone else's code, I should have already done it and I will with future projects. It's good that you removed the title screen, it sucked. I'm replacing it with a smb3 style intro where mario basicly just runs around. I'll post the latest bin with source remade from the above with comments soon. Edited April 18, 2006 by MausBoy Quote Link to comment Share on other sites More sharing options...
Jess Ragan Posted April 19, 2006 Share Posted April 19, 2006 That particular Game & Watch was pretty simple. Basically, platforms scrolled from right to left automatically, and Mario had to survive until reaching the end of the screen. When he finished the round, an elevator would take him to the next stage. It's a lot like the side-scrolling version of Man Goes Down that was posted here in the Batari BASIC forums a few months ago. JR Quote Link to comment Share on other sites More sharing options...
MausBoy Posted April 19, 2006 Author Share Posted April 19, 2006 I still have a couple of variables left and I havent given up on the multisprite engine so I might actually be able to finish this. When I do there will be no score or timer so the objective will be to beat all the levels without running out of lives. I'd like to do a couple of regular above-ground worlds, a couple of water worlds, and a castle. I'm thinking this should be a prequal that ends right where smb1 starts. Quote Link to comment Share on other sites More sharing options...
Shawn Posted April 19, 2006 Share Posted April 19, 2006 I still have a couple of variables left and I havent given up on the multisprite engine so I might actually be able to finish this. When I do there will be no score or timer so the objective will be to beat all the levels without running out of lives. I'd like to do a couple of regular above-ground worlds, a couple of water worlds, and a castle. I'm thinking this should be a prequal that ends right where smb1 starts. That would be perfect. I can't wait to see this completed Quote Link to comment Share on other sites More sharing options...
MausBoy Posted April 19, 2006 Author Share Posted April 19, 2006 Can someone help me do the math to get accurate collision detection beneath mario? I need for him to fall if he's not standing on anything and land if he falls onto something. The playfield is 31 in width and the horizontal resolution for player sprites is 164, so I need to be able to tell if the one or two playfield pixels the player is standing over are on or off. Quote Link to comment Share on other sites More sharing options...
MausBoy Posted April 20, 2006 Author Share Posted April 20, 2006 (edited) I now have decent collision detection using a missile hidden in his nose, and i've added gravity, you can fall of stuff and fall in the holes and die now. I wonder if I'll be able to create a game that is cart worthy out of this, if I switch over to original characters. Can anyone tell me how to switch this game over to the multisprite kernel? I want to be able to add enemies and I can't without using it, but all my attempts to convert it won't compile. Edited April 20, 2006 by MausBoy Quote Link to comment Share on other sites More sharing options...
+Atarius Maximus Posted April 20, 2006 Share Posted April 20, 2006 I now have decent collision detection using a missile hidden in his nose, and i've added gravity, you can fall of stuff and fall in the holes and die now. I wonder if I'll be able to create a game that is cart worthy out of this, if I switch over to original characters. Can anyone tell me how to switch this game over to the multisprite kernel? I want to be able to add enemies and I can't without using it, but all my attempts to convert it won't compile. There's still bugs in the multisprite kernel. I found that if you remove the pfscroll, pfhline, and pfclear statements, the original code you posted will compile fine in the multisprite kernel -- those commands are probably not implemented yet in that kernel. Maybe batari can help out here? Steve Quote Link to comment Share on other sites More sharing options...
s0c7 Posted April 20, 2006 Share Posted April 20, 2006 (edited) I found that if you remove the pfscroll, pfhline, and pfclear statements, the original code you posted will compile fine in the multisprite kernel -- those commands are probably not implemented yet in that kernel. I may be wrong about this, but it was my understanding those commands don't exist (and won't) in that kernel because of the different way the playfield is handled. batari should be able to shed more light on the subject. AM, AFAIK you're the only person who has actually tried anything with that kernel. - David Edited April 20, 2006 by s0c7 Quote Link to comment Share on other sites More sharing options...
Gregory DG Posted April 20, 2006 Share Posted April 20, 2006 a missile hidden in his nose Well, it *is* big enough to hide a missile, isn't it? I'm sure there are a few bats in there too. Quote Link to comment Share on other sites More sharing options...
MausBoy Posted April 20, 2006 Author Share Posted April 20, 2006 (edited) I hope those commands will be implemented in the MSK, especially considering the much increased amount of pixels we'll be working with. I designed the bad guys out of background pixels and it makes for an awesome jump in sprite numbers, it's a shame I can't use this yet. I was able to replecate animated goombas, koopa troopas, and even king koopa himself very nicely with pfpixel routines. Since they retain an x,y coordinate I can test for collisions with them the same as with any other sprite and keep them seperated from background pixels. Even not using those commands though, and just trying to make a simple program to print HI in pfpixels with the MSK won't compile for me. Anything I compile with it, even a program with no graphics commands, creates a mirrored playfield with a bunch of random pfpixels. I think I'm going to wait out the first complete release and keep practicing until then. Edited April 20, 2006 by MausBoy Quote Link to comment Share on other sites More sharing options...
s0c7 Posted April 20, 2006 Share Posted April 20, 2006 Even not using those commands though, and just trying to make a simple program to print HI in pfpixels with the MSK won't compile for me. Again, I may have misunderstood this, but the impression I got back when the nature of the MSK was being debated was that you had to define the playfield with the PLAYFIELD command. It would be defined and altered in a "everything at once" type deal. All the other PF commands won't work. Quote Link to comment Share on other sites More sharing options...
MausBoy Posted April 21, 2006 Author Share Posted April 21, 2006 Ah, I somehow missed that it wouldn't work with scrolling games. Oh well, I'm sure I can make something fun with this. Quote Link to comment Share on other sites More sharing options...
s0c7 Posted April 21, 2006 Share Posted April 21, 2006 As best I remember, scrolling was supposed to work, but only up/down. Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted April 25, 2006 Share Posted April 25, 2006 The problem with the multi-sprite kernel is that all the RAM that was being used for the playfield - which allowed scrolling, plotting, etc. - is now being used for the sprites. So the playfield is static. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.