 # Captain Spazer

Members

134

## Community Reputation

41 Excellent

• Rank
Chopper Commander ## Profile Information

• Gender
Male
• Interests
Retro videogames ofcourse!
• Currently Playing
Mike Tyson's Punch Out & Pitfall 2
1. 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?
2. 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
3. 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.
4. 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
5. 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
6. 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
7. ## Platformer game - way over my head with collisions.

Thank you, my issue is that I don't read through my codes carefully enough. something I REALLY need to work on it seems.
8. 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
9. ## Platformer game - way over my head with collisions.

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
10. I got it working again, it turned out I had missed a space.
11. 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.
12. Oh yeah, thanks guys! Silly of me.
13. 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.
14. 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
15. Ahh, that was very hard, but I got it working now that I understood that the direction of movement mattered.
×
×
• Create New...