Jump to content

Captain Spazer

Members
  • Content Count

    163
  • Joined

  • Last visited

Everything posted by Captain Spazer

  1. Thank you, glad you liked it 😃
  2. I'm almost done with Dragon Hunt, a nerve-wrecking adventure game where you; the brave adventurer enters the dragons dungeon armed only with your wits and a couple of magic arrows. At this stage I am mainly hunting for bugs, if you encounter any bugs please report them. As you go through the dungeon you will notice that your senses tell you things about your surroundings. These symbols of your senses are located at the top of your screen: The wind symbol tells you that you feel a draft and that means an acid filled pit is nearby. The noise symbol tells you that you hear a noise and that means a bat is nearby. The arrow symbol tells you that you see an arrow nearby. The dragon symbol tells you that the dragon is nearby. At the bottom left side of the screen is your quiver that indicates how many arrows you have. If you step into the room with the acid pit, you fall to your death. If you step into the room the dragon is in, you will be incinerated. If you step into the room the bat is in, the bat will move you to a random room. If you step into the room with the arrow, you get an extra arrow, but only if you have less then 3, if you already have 3, you get 200 points instead. How do I win this thing? You win if you figure out where the dragon is, and shoot a magic arrow into the room that the dragon is in, this nets you 1000 points. Controls At the titlescreen flip the reset switch to begin the game. In the dungeon, you move from room to room by moving the joystick up, down, left and right. In the dungeon, you fire your arrow by holding down the firebutton and moving the joystick in the direction you wish to shoot. Upon a death scene, the score counter will blink when you can flip the reset switch to begin a new game again. What gives? The dungeon is really big and weird! The dungeon is a 4x4 grid, but the kicker is that it loops from top to bottom and side to side in order to add an extra challenge, keep in mind that you can't sense what is in a room at the far top/bottom or left/right, you can only sense what is next to your current room. Every room in the dungeon is color coded so you should quickly get a hang of orientation. Download - Dragon_Hunt_V0.9.bin
  3. Okay, I managed to make it all work, and I expanded the dungeon to a whopping of 16 rooms. I had to expand the romsize to 8k, though and I'm struggling with memory yet again for all the checks, there has to be a memory saving way to check when the dragon is in room 1 to give you a clue when you are in room 0,2 or 6. Map of the dungeon: [30 ][31 ][32 ][33 ] [20 ][21 ][22 ][23 ] [10 ][11 ][12 ][13 ] [A0 ][A1 ][A2 ][A3 ] Basically, it's a first person hunt the wumpus with a skin. EDIT: I managed to make the code smaller and free up a lot of memory by making the code a lot more efficient. Now my only trouble is how I'm going to do a check if both the dragon and the pit is next to the room the player is in. The piece of code: rem RANDOM COUNTERS Dragon_Spawner = (rand&15) + 1 Pit1_Spawner = (rand&15) + 1 rem TRANSLATES RANDOM COUNTER INTO POSITION if Dragon_Spawner = 1 then Dragon_Position = 1 if Dragon_Spawner = 2 then Dragon_Position = 2 if Dragon_Spawner = 3 then Dragon_Position = 3 if Dragon_Spawner = 4 then Dragon_Position = 10 if Dragon_Spawner = 5 then Dragon_Position = 11 if Dragon_Spawner = 6 then Dragon_Position = 12 if Dragon_Spawner = 7 then Dragon_Position = 13 if Dragon_Spawner = 8 then Dragon_Position = 20 if Dragon_Spawner = 9 then Dragon_Position = 21 if Dragon_Spawner = 10 then Dragon_Position = 22 if Dragon_Spawner = 11 then Dragon_Position = 23 if Dragon_Spawner = 12 then Dragon_Position = 30 if Dragon_Spawner = 13 then Dragon_Position = 31 if Dragon_Spawner = 14 then Dragon_Position = 32 if Dragon_Spawner = 15 then Dragon_Position = 33 if Dragon_Spawner = 16 then Dragon_Position = 33 if Pit1_Spawner = 1 then Pit1_Position = 1 if Pit1_Spawner = 2 then Pit1_Position = 2 if Pit1_Spawner = 3 then Pit1_Position = 3 if Pit1_Spawner = 4 then Pit1_Position = 10 if Pit1_Spawner = 5 then Pit1_Position = 11 if Pit1_Spawner = 6 then Pit1_Position = 12 if Pit1_Spawner = 7 then Pit1_Position = 13 if Pit1_Spawner = 8 then Pit1_Position = 20 if Pit1_Spawner = 9 then Pit1_Position = 21 if Pit1_Spawner = 10 then Pit1_Position = 22 if Pit1_Spawner = 11 then Pit1_Position = 23 if Pit1_Spawner = 12 then Pit1_Position = 30 if Pit1_Spawner = 13 then Pit1_Position = 31 if Pit1_Spawner = 14 then Pit1_Position = 32 if Pit1_Spawner = 15 then Pit1_Position = 33 if Pit1_Spawner = 16 then Pit1_Position = 33 rem IF THE ROOM THE PLAYER IS IN IS NEXT TO THE DRAGON OR THE PIT, THE BACKGROUND CHANGES COLOR if Room_Number = Dragon_Position - 1 then COLUBK = $34 if Room_Number = Dragon_Position + 1 then COLUBK = $34 if Room_Number = Dragon_Position + 10 then COLUBK = $34 if Room_Number = Dragon_Position - 10 then COLUBK = $34 if Room_Number = Pit1_Position - 1 then COLUBK = $A0 if Room_Number = Pit1_Position + 1 then COLUBK = $A0 if Room_Number = Pit1_Position + 10 then COLUBK = $A0 if Room_Number = Pit1_Position - 10 then COLUBK = $A0
  4. I'm fiddling with a 3D dungeon crawler, the dungeon is made up of a 3x3 grid where each room is stored in variable "a" 0 - 9 And the big bad monster is stored in variable "h" which randomly chooses between number 1-9 My question is: How do I make it so that the number that "h" chooses, like 3 for example, a sprite is shown in room number 3? aka variable "a" = 3 EDIT: I figured it out, I could simply do an "if h = a" calculation. Now I do have another question in a similar vain, but a bit more complicated that I need help optimizing. Any thoughts on how to make something like this more efficient? My thoughts is like this: If the dragon is calculated to be in room a1, and the player is in an adjacant room, in this case adjacant rooms would be a4 and a0 then player1's sprite is shown as an icon on the screen, indicating that the dragon is in an adjacant room. The way I set the code up, it works sometimes, sometimes the icon shows, sometimes the icon does not show up, also it eats up a big chunk of memory. rem dragon is located in a1 if n = 1 && a = 4 then player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end if n = 1 && a = 0 then player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end rem dragon is located in a 2 if n = 2 && a = 5 then player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end if n = 2 && a = 0 then player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end rem dragon is located in a 3 if n = 3 && a = 4 then player1x = 50 : player1y=50 : player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end if n = 3 && a = 0 then player1x = 50 : player1y=50 : player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end if n = 3 && a = 5 then player1x = 50 : player1y=50 : player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end if n = 3 && a = 6 then player1x = 50 : player1y=50 : player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end rem dragon is located in a 6 if n = 6 && a = 3 then player1x = 50 : player1y=50 : player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end if n = 6 && a = 7 then player1x = 50 : player1y=50 : player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end if n = 6 && a = 8 then player1x = 50 : player1y=50 : player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end rem dragon is located in a 7 if n = 7 && a = 6 then player1x = 50 : player1y=50 : player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end if n = 7 && a = 4 then player1x = 50 : player1y=50 : player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end rem dragon is located in a 8 if n = 8 && a = 6 then player1x = 50 : player1y=50 : player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end if n = 8 && a = 5 then player1x = 50 : player1y=50 : player1: %11111111 %11111111 %00100011 %00000011 %01001011 %11111111 %11110101 %00001111 end
  5. I have been trying to figure out how pfvline works but I can't quite seem to get the hang of putting a hole in the wall. Atm I got this: "pfvline 31 0 10 on" to make a solid long wall and scroll it to the left. Any ideas how to knock a hole in it at a random y position?
  6. I am incompetent when it comes to math, hoping someone more adept could help me out with this one: Code for collision detection for 8x8 sprite, need it to be for a 16x8 sprite rem player moves right if !joy0right then goto __Skip_Joy0_Right if player1x >= _P_Edge_Right then goto __Skip_Joy0_Right temp5 = (player1y-1)/8 temp6 = (player1x-9)/4 if temp6 < 34 then if pfread(temp6,temp5) then goto __Skip_Joy0_Right temp3 = (player1y-8)/8 if temp6 < 34 then if pfread(temp6,temp3) then goto __Skip_Joy0_Right __Skip_Joy0_Right rem player moves left if !joy0left then goto __Skip_Joy0_Left if player1x <= _P_Edge_Left then goto __Skip_Joy0_Left temp5 = (player1y-1)/8 temp6 = (player1x-18)/4 if temp6 < 34 then if pfread(temp6,temp5) then goto __Skip_Joy0_Left temp3 = (player1y-8)/8 if temp6 < 34 then if pfread(temp6,temp3) then goto __Skip_Joy0_Left
  7. Would be neat, yeah. I got a basic engine going: Jump on enemies, breaking blocks, walking, jumping, running and super jumping. I need to figure out how to do better platforming enemies as for now they can't detect walls and that makes things tricky when there are holes in the ground, heh.
  8. This is how I do extremely simple platforming enemy AI that can walk and fall of ledges: rem gravity player0y = player0y + 1 rem enemy stops when in contact with playfield if collision(player0,playfield) then player0y = player0y - 1 rem enemy walks right or left if it touches the screen borders if u = 0 then _P0_L_R = _P0_L_R - 0.35 if u = 1 then _P0_L_R = _P0_L_R + 0.35 if player0x = 15 then u = 1 if player0x = 140 then u = 0
  9. I kind of figured out a way to do it, making pretty good mario styled platforming sections with good holes and some higher platforms in the sky. With enough pieces a randomly generated mario platformer would be doable: rem Generated 26/04/2020 12:55:57 by Visual bB Version 1.0.0.554 rem ********************************** rem *<filename> * rem *<description> * rem *<author> * rem *<contact info> * rem *<license> * rem ********************************** a = 0 player0x = 20 : player0y = 72 main COLUBK=$00 COLUPF=$0E COLUP0=$44 scorecolor = $0E player0: %01100110 %00100100 %01011010 %00111100 %00011000 %00011100 %00011000 %00000000 end rem starting with full row of blocks on ground if a = 0 then var40=%11111111 : var41=%11111111 : var42=%11111111 : var43=%11111111 : var20=%00000000 : var21=%00000000 : var22=%00000000 : var23=%00000000 : a = 5 rem spawns a row at lowest level if a = 1 then var40=%11111111 : var41=%11111111 : var42=%11111111 : var43=%00000011 : var20=%00000000 : var21=%00000000 : var22=%00000000 : var23=%00000000 : a = 5 rem air platforms if a = 2 then var40=%11111111 : var41=%11111111 : var42=%11111111 : var43=%00001111 : var20=%00000000 : var21=%00000000 : var22=%00000000 : var23=%11000000 : a = 5 if a = 3 then var40=%11111111 : var41=%11111111 : var42=%11111111 : var43=%00001111 : var20=%00000000 : var21=%00000000 : var22=%00000000 : var23=%11110000 : a = 5 drawscreen rem scrolls playfield b = b + 1 if b = 1 then pfscroll left left if b >= 10 then b = 0 c = c + 1 if c = 255 then a = (rand&3) : c = 0 goto main
  10. I'm experimenting with a randomly generated horizontal scrolling playfield, trying to make something like the levels in the Game & Watch version of Super Mario Bros, it works but it's way to random, and I was hoping someone had some tips on how to store premade parts of the playfield that could be choosen and placed at random as the level scrolls in. My code so far simply involves turning pfpixels on at points where the ground and blocks should be: a = 0 player0x = 20 : player0y = 72 main COLUBK=$00 COLUPF=$0E COLUP0=$44 scorecolor = $0E player0: %01100110 %00100100 %01011010 %00111100 %00011000 %00011100 %00011000 %00000000 end rem spawns a row at lowest level if a = 0 then pfpixel 31 10 on rem spawns blocks at highest level if a = 1 then pfpixel 31 2 on rem spawns blocks at middle level if a = 2 then pfpixel 31 6 on if a = 3 then pfpixel 31 6 on : pfpixel 31 10 off : pfpixel 31 2 off drawscreen rem scrolls playfield b = b + 1 if b = 1 then pfscroll left if b >= 31 then b = 0 c = c + 1 if c = 60 then a = (rand&3) if c = 61 then c = 0 goto main
  11. Thank you, my issue is that I don't read through my codes carefully enough. something I REALLY need to work on it seems.
  12. While experimenting with a randomly scrolling maze, I managed to make a maze that's pretty similar to Entombed, I'll share it here for those who are curious about doing similar games: Bin - Entombed Maze.bin Bas - Entombed Maze.bas
  13. I seem to be over my head with this one, I'm doing a platformer experiment, the engine works perfectly, but implementing enemies seems to be problematic: Any ideas on what might be wrong with the code below? In general: There are 0-3 states of player0: 0 means no spawn, 1 means an enemy, 2 is also an enemy, 3 is gold coins for you to pickup. Picking up gold coins work, but colliding with player0 when player0 isn't gold coins does not register at all, player0 just passes through player1 without lowering pfscore1 at all. rem player picks up gold if Monster_Type > 2 && collision(player0,player1) then score = score + 100 : player0x = 255 : player0y = 255 : Monster_Type = 0 rem take damage if player0 isn't gold if Monster_Type < 3 && collision(player0,player1) then pfscore1/4
  14. I got it working again, it turned out I had missed a space.
  15. I got a mystical error message I cannot identify, any ideas what this error message means? C:\Program Files\Stella\VBB\Projects\Castle Dracula\default.bas.asm (2875): error: Value in 'lda #1000' must be <$100. Unrecoverable error(s) in pass, aborting assembly! Complete. Errors were encountered during assembly.
  16. Oh yeah, thanks guys! Silly of me.
  17. I'm having a bit of trouble with an idea, I'm using the multisprite kernel and I got 4 of the sprites as things to pick up to get score, this works fine. I'm trying to get a counter working so that once the four items have been collected an event triggers, but I can't get it to trigger. This is the code I'm using for collision and adding score: if (player0y + 6) >= player2y && player0y <= (player2y + 10) && (player0x + 10) >= player2x && player0x <= (player2x - 1) then score = score + 1 : player2y=200 if (player0y + 6) >= player3y && player0y <= (player3y + 10) && (player0x + 10) >= player3x && player0x <= (player3x - 1) then score = score + 1 : player3y=200 if (player0y + 6) >= player4y && player0y <= (player4y + 10) && (player0x + 10) >= player4x && player0x <= (player4x - 1) then score = score + 1 : player4y=200 if (player0y + 6) >= player5y && player0y <= (player5y + 10) && (player0x + 10) >= player5x && player0x <= (player5x - 1) then score = score + 1 : player5y=200 Now, if I was to add at the end for example p = p + 1 when colliding with the sprite, it does nothing. My none working experiment: if p <=4 && player0x < player1x then _P1_L_R = _P1_L_R - 0.10 : REFP1=0 if p <=4 && player0x > player1x then _P1_L_R = _P1_L_R + 0.10 : REFP1 = 8 if p <=4 && player0y < player1y then _P1_U_D = _P1_U_D - 0.10 if p <=4 && player0y > player1y then _P1_U_D = _P1_U_D + 0.10 if (player0y + 6) >= player2y && player0y <= (player2y + 10) && (player0x + 10) >= player2x && player0x <= (player2x - 1) then score = score + 1 : player2y=200 : p = p + 1 if (player0y + 6) >= player3y && player0y <= (player3y + 10) && (player0x + 10) >= player3x && player0x <= (player3x - 1) then score = score + 1 : player3y=200 : p = p + 1 if (player0y + 6) >= player4y && player0y <= (player4y + 10) && (player0x + 10) >= player4x && player0x <= (player4x - 1) then score = score + 1 : player4y=200 : p = p + 1 if (player0y + 6) >= player5y && player0y <= (player5y + 10) && (player0x + 10) >= player5x && player0x <= (player5x - 1) then score = score + 1 : player5y=200 : p = p + 1 Since this code doesn't say what happens when p > 4 then player1 should stop.
  18. While on the subject of math, how would I go about looping the spawn of the pfpixels for example 10 times? My current code seems to be wonky, sometimes I get 8 pfpixels, sometimes 9 and sometimes 10: Loop_Lettuce d = 0 Place_Lettuce temp1 = (rand&31) temp2 = (rand&14) - 1 pfpixel temp1 temp2 on d = d +1 if d >= 10 then goto main goto Place_Lettuce
  19. Ahh, that was very hard, but I got it working now that I understood that the direction of movement mattered.
  20. I'm struggling with my math and I could use a little help: The player collides with pfpixel, pfpixel gets turned off, but the collision detection is wonky. The player sprite is 8x8. x = (player0x-18)/4 : y = (player0y)/8 x = (player0x-18)/4 : y = (player0y)/8 if collision(playfield,player0) then pfpixel x y off Entire code: rem Generated 30/01/2020 19:42:08 by Visual bB Version 1.0.0.554 rem ********************************** rem *<filename> * rem *<description> * rem *<author> * rem *<contact info> * rem *<license> * rem ********************************** start set smartbranching on dim rand16 = z dim _P0_L_R = player0x.k dim _P0_U_D = player0y.l a = 10 player0x = 50 player0y = 10 rem FIX THIS CODE! MAKE IT SPAWN 10 PFPIXELS: Loop_Lettuce d = 0 Place_Lettuce temp1 = (rand&31) temp2 = (rand&7) - 1 pfpixel temp1 temp2 flip d = d +1 if d = 10 then goto main goto Place_Lettuce main COLUP0=$0E COLUP1=$33 COLUBK=$D8 COLUPF= $DC rem PLAYER0 Bunny if a = 10 then player0: %00110100 %00111100 %01111100 %00111110 %00011101 %00000110 %00000100 %00000100 end if a = 20 then player0: %00110000 %00100000 %00011010 %00111100 %00011110 %00001101 %00000010 %00001100 end if a = 30 then player0: %00000100 %00001100 %00011110 %00111101 %01110110 %10100100 %00001000 %00000000 end if a > 30 then a = 0 rem flip p0 sprite if c = 0 then REFP0=0 if c = 1 then REFP0=8 drawscreen rem ANIMATE AND MOVE BUNNY if joy0up then _P0_U_D = _P0_U_D - 0.50 : a = a + 1 if joy0down then _P0_U_D = _P0_U_D + 0.50 : a = a + 1 if joy0left then _P0_L_R = _P0_L_R - 0.50 : a = a + 1 : c = 1 if joy0right then _P0_L_R = _P0_L_R + 0.50 : a = a + 1 : c = 0 if !joy0left && !joy0right && !joy0up && !joy0down then a = 10 rem BUNNY EATS LETTUCE x = (player0x-18)/4 : y = (player0y)/8 x = (player0x-18)/4 : y = (player0y)/8 if collision(playfield,player0) then pfpixel x y off goto main
  21. Curious if there is a way to make player1 overlap missile0? I.E: When player1 is in contact with missile0, player1 doesn't dissapear behind missile0
  22. Well, the reason is that I got a map grid of 5x5 rooms. If it's not possible, or super hard to do I guess I'll simply have to increase the number of rooms. I
  23. I only have a basic grasp of the rnd, what I learned is thanks too Randomterrains wonderful website. But, I'm in a situation where I need to pick a random number between 0 and 5, is that possible somehow with math wizardry?
×
×
  • Create New...