-
Content Count
367 -
Joined
-
Last visited
Content Type
Profiles
Member Map
Forums
Blogs
Gallery
Calendar
Store
Everything posted by Retro Lord
-
Well, the issue is that I just can't get the code to do what I want. The 2 first lines are working.(I think) The bottom part not really. What I'm after is, if player1 is either directly left, right, above or below the color change initiates. As it is now the color changes if player0 is left, right, above or below without regard for how close they are too each other. if player0x > player1x then _dragon_xpos = player0x - player1x : if _dragon_xpos < 8 then COLUPF=$DA : goto __Skip_Proximity if player1x > player0x then _dragon_xpos = player1x - player0x : if _dragon_xpos < 5 then COLUPF=$DA : goto __Skip_Proximity if player0y > player1y then _dragon_ypos = player0y - player1y : if _dragon_ypos < 3 then COLUPF=$DA : goto __Skip_Proximity if player1y > player0y then _dragon_ypos = player1y - player0y : if _dragon_ypos < 3 then COLUPF=$DA : goto __Skip_Proximity __Skip_Proximity
-
I dunno, it seems like nothing I do quite works with that code.
-
Okay, I've almost fixed it. This parts now works: if player0x > player1x then _dragon_xpos = player0x - player1x : if _dragon_xpos < 8 then COLUPF=$DA : goto __Skip_X_Check if player1x > player0x then _dragon_xpos = player1x - player0x : if _dragon_xpos < 5 then COLUPF=$DA __Skip_X_Check Now I just have to find the right numbers for the y position
-
Ahh, good to know, thanks!
-
Hm, I still get the same problem. I'm thinking it's a math thing. I've fiddled with the numbers and almost got it working once. I'm sure it's this part that needs figuring out what number it needs: if _dragon_xpos < 4 If I only was better at understanding math
-
Neat changes =) I have been adding some new stuff. Like the dragon being randomly placed with a rand counter so it is always placed along the grid. It's very memory heavy but works like a dream! =) DnD04.bas
-
A question about this code again. It appears that it works when player0 is next to the dragon, which is great. But even if player1 is all the way across the playfield and player0 is at the bottom it registers as long as they are nex ´t to each other. How would I fix it so it takes the y value into account aswell? if player0x > player1x then _dragon_xpos = player0x - player1x : if _dragon_xpos < 5 then COLUPF=$DA : goto __Skip_Proximity if player1x > player0x then _dragon_xpos = player1x - player0x : if _dragon_xpos < 5 then COLUPF=$DA : goto __Skip_Proximity if player0y > player1y then _dragon_ypos = player0y - player1y : if _dragon_ypos < 5 then COLUPF=$DA : goto __Skip_Proximity if player1y > player0y then _dragon_ypos = player1y - player0y : if _dragon_ypos < 5 then COLUPF=$DA __Skip_Proximity
-
Cheers! Got it working perfectly now. Man, I'm so glad everything is getting together now.
-
Major update thanks too the help of Random Terrain and bogax. The dragon is now placed in the dungeon according too the grid. And I've almost got the visual clue working for when you get near the dragon the playfield is supposed to go green but I don't got it down just yet. DOWNLOAD - DnD04.bas
-
Yeah I got it working with a random counter. But I suck at math. Player1 is 7 pixels tall and 4 wide. I calculated the x placement perfectly. But I'm having problem wit the y placements. If I want it to go down it's own length 1 time would that be +8 or +9? +7 wasn't quite right it turned out.
-
Another question: I want player1 to be randomly placed on the playfield, but only in the pfpixel "grid". of pfpixels12-21 across and 3-9 vertical. Would it be easiest to do this with a t=rand&15) event?
-
Haha, thanks Random Terrain! I did not see that. That just goes to show how easy it is to make mistakes =)
-
Thank you bogax, that was awesome of you =)
-
I'm guessing I put it in the wrong position or some other thing that I overlooked but can't figure out =/ Download - d_and_d_demo_2015y_01m_16d_2352t.bas
-
Okay, hm. I still get a syntax error. Man this is difficult. I did the dim: dim _dragon_xpos = k And I added: If player0x > player1x then _dragon_xpos = player0x - player1x : if _dragon_xpos < 5 then m=10 : goto __Skip_Proximity If player1x > player0x then _dragon_xpos = player1x - player0x : if _dragon_xpos < 5 then m=10 : goto __Skip_Proximity __Skip_Proximity
-
My sprites are 8x4, too match the pfpixels. So if I understand the math that would be +3 ninstead of +7 if it was 8x8 in size?
-
Ah okay. So this would be a correct dim? dim _My_Temp01 = k
-
Hm, I'm experimenting with this code but I always get an error message. Do I need to setup _My_Temp01 anywhere ellse then in this line of code? If player0x > player1x then _My_Temp01 = player0x - player1x : if _My_Temp01 < 5 then m=10 : goto __Skip_Proximity If player1x > player0x then _My_Temp01 = player1x - player0x : if _My_Temp01 < 5 then m=10 : goto __Skip_Proximity If player0y > player1y then _My_Temp01 = player0y - player1y : if _My_Temp01 < 5 then m=10 : goto __Skip_Proximity If player1y > player0y then _My_Temp01 = player1y - player0y : if _My_Temp01 < 5 then m=10 __Skip_Proximity Entire source: rem CODE INSPIRED BY Atarius Maximus at http://www.atariage.com/forums/index.php?showtopic=109288 include div_mul.asm TITLE playfield: ..XX..XXX.XXX.XX..XXX.XXX..XX... ..X.X.XX..XXX.X.X.X.X.X.X..X.... ..XX..X.X.X.X.XXX.XXX.X.X.XX.... ................................ ..............XXX............... ..............X.X............... ..............X.X............... ................................ XX..X.X.XXX.XX..XXX.XXX.XXX..XX. X.X.X.X.X.X.X.X.XX..X.X.X.X..X.. XX..XXX.X.X.XXX.XXX.XXX.X.X.XX.. end COLUPF=rand drawscreen if joy0fire goto charselect goto TITLE charselect player0x=81 : player0y=49 if j=0 then COLUP0=$2E if j=1 then COLUP0=$AE if j=2 then COLUP0=$52 COLUPF=rand if j=0 then player0: %00000000 %00101000 %00101000 %00010000 %01111000 %01000000 %01010000 %01010000 end if j=1 then player0: %00000000 %01111000 %01010000 %01010000 %01111000 %01000000 %00010000 %01011000 end if j=2 then player0: %00000000 %00101000 %00101000 %00010000 %01111000 %01000000 %01010000 %00010000 end playfield: ................................ ................................ ................................ ..............XXXXXX............ ..............X....X............ XXXXXXXXXXXXXXX....XXXXXXXXXXXXX ..............X....X............ ..............XXXXXX............ ................................ ................................ ................................ end drawscreen if joy0up then j=0 if joy0down then j=1 if joy0left then j=2 if joy0up && joy0fire then goto START : COLUPF=rand if joy0down && joy0fire then goto START : COLUPF=rand if joy0left && joy0fire then goto START : COLUPF=rand goto charselect START dim _Bit0_JoyU = a dim _Bit1_JoyD = a dim _Bit2_JoyL = a dim _Bit3_JoyR = a dim _PF_LR = f dim _PF_UD = g dim _classes = j player0x = 76 player0y = 72 missile0x=120 missile0y=60 player1x=rand player1y=rand scorecolor=$0E pfscorecolor = rand const pfscore=1 pfscore1 = 21 pfscore2 = 255 _PF_LR = (player0x-15)/4 _PF_UD = (player0y/8)-1 rem POSSIBLY INEFFICIENT CODE, SEPARATE COLOR INFO FOR EACH FRAME... player1: %00000000 %00101000 %00111100 %00011000 %00111000 %00000100 %00111000 %00011000 end playfield: ................................ ..........XXXXX..XXXXX.......... ..........X..........X.......... ..........X..........X.......... ..........X..........X.......... ..........X..........X.......... ..........X..........X.......... ..........X..........X.......... ..........X..........X.......... ..........XXXXX..XXXXX.......... ................................ end __Main_Loop rem Missile0 = spikhal rem player1 = drake rem missile1= missile0height=7 NUSIZ0=$20 if j=0 then COLUP0=$2E if j=1 then COLUP0=$AE if j=2 then COLUP0=$52 if collision(player0,missile1) then goto PIT ballheight = 7 CTRLPF = $21 h=h+1 If player0x > player1x then _My_Temp01 = player0x - player1x : if _My_Temp01 < 5 then m=10 : goto __Skip_Proximity If player1x > player0x then _My_Temp01 = player1x - player0x : if _My_Temp01 < 5 then m=10 : goto __Skip_Proximity If player0y > player1y then _My_Temp01 = player0y - player1y : if _My_Temp01 < 5 then m=10 : goto __Skip_Proximity If player1y > player0y then _My_Temp01 = player1y - player0y : if _My_Temp01 < 5 then m=10 __Skip_Proximity rem Walk if n > 0 then AUDV0 = 15 : AUDC0 = 1 : AUDF0 = 5 : n = n - 1: if n = 0 then AUDV0 = 0 rem Dragon if m > 0 then AUDV0 = 15 : AUDC0 = 2 : AUDF0 = 10 : m = m - 1: if m = 0 then AUDV0 = 0 rem Pit if p > 0 then AUDV0 = 15 : AUDC0 = 3 : AUDF0 = 13 : p = p - 1: if p = 0 then AUDV0 = 0 if h=255 then pfscore2=pfscore2/4 : h=0 if player0x<60 then player0x=60 : _PF_LR = _PF_LR + 1 if missile1x<60 then missile1x=rand if player1x<60 then player1x=rand if player0x>96 then player0x=96 : _PF_LR = _PF_LR - 1 if missile1x>96 then missile1x=rand if player1x>96 then player1x=rand if player0y<24 then player0y=24 : _PF_UD = _PF_UD + 1 if missile1y<24 then missile1y=rand if player1y<24 then player1y=rand if player0y>72 then player0y=72 : _PF_UD = _PF_UD - 1 if missile1y>72 then missile1y=rand if player1y>72 then player1y=rand COLUP1=$00 missile1height=8 if !joy0up then _Bit0_JoyU{0} = 0 : goto __Skip_Fire if _Bit0_JoyU{0} then goto __Skip_Fire _Bit0_JoyU{0} = 1 player0y = player0y - 8 _PF_UD = _PF_UD - 1 : n=10 __Skip_Fire if !joy0down then _Bit1_JoyD{1} = 0 : goto __Skip_Fire2 if _Bit1_JoyD{1} then goto __Skip_Fire2 _Bit1_JoyD{1} = 1 player0y = player0y + 8 _PF_UD = _PF_UD + 1 : n=10 __Skip_Fire2 if !joy0left then _Bit2_JoyL{2} = 0 : goto __Skip_Fire3 if _Bit2_JoyL{2} then goto __Skip_Fire3 _Bit2_JoyL{2} = 1 player0x = player0x - 4 _PF_LR = _PF_LR - 1 : n=10 __Skip_Fire3 if !joy0right then _Bit3_JoyR{3} = 0 : goto __Skip_Fire4 if _Bit3_JoyR{3} then goto __Skip_Fire4 _Bit3_JoyR{3} = 1 player0x = player0x + 4 _PF_LR = _PF_LR + 1 : n=10 __Skip_Fire4 rem 12-21 across rem 3-9 vertical if joy0fire then pfpixel _PF_LR _PF_UD off : goto __Skip_PF pfpixel _PF_LR _PF_UD on __Skip_PF drawscreen goto __Main_Loop PIT player0x=80 : player0y=20 missile0x=200 : missile0y=200 player1x=200 : player1y=200 missile1x=200 : missile1y=200 ballx=200 : bally=200 fall COLUP0=rand playfield: ................................ ................................ ................................ XXXXXXXXX..............XXXXXXXXX XXXXXXXXX..............XXXXXXXXX XXXXXXXXX..............XXXXXXXXX XXXXXXXXX..............XXXXXXXXX XXXXXXXXX..............XXXXXXXXX XXXXXXXXX..............XXXXXXXXX XXXXXXXXX..............XXXXXXXXX XXXXXXXXX..............XXXXXXXXX end drawscreen player0y=player0y+1 if player0y>90 then player0y=200 : player0x=200 if joy0down then reboot goto fall
-
I thought that this demo might be able too help others wanting to do a small dungeon exploration demo. So I figured we would learn together! I'm basing this on the Hunt the Wumpus mechanics. You try too find the dragon lurking somewhere in the dark while avoiding bottomless pits and other things. I'm hoping this turns out to be helpful for you! But I reserve this particular game so if you are basing your game on it please change it enough too look different. I will do updates as I figure out some clever solutions so in the end we'll end up with a "hunt the wumpus" engine that anyone can use! -------------------------------- Controls Press the button on the titlescreen to go too the class selection screen. Left, up and down shows you the classes at the titlescreen so you can see which guy you want to be. left, up or down and pressing the button selects the class and starts the game. Left, right, up and down moves your hero in the dungeon. When you fall down the pit press down to restart the game. -------------------------------- So far I have: Titlescreen Class selection, choose between a Barbarian, Thief or Mage. I'm going to add another class later. The dungeon. Thanks too RandomTerrain for teaching me how to use pfpixel on/off. Tiles you've been on are lit, the ones you haven't been to are unlit. Hero movement -------------------------------- WIP Some kind of clue when you are next too the dragon or the pits. Attacking the dragon. (You'll have 2 tries to kill it. Working timer -------------------------------- DOWNLOAD - DnD0.3.bas
-
Is it safe too use the Dungeons and dragons name?
Retro Lord replied to Retro Lord's topic in batari Basic
It seems I will have to make more then 1 game here, haha. Alright I'll go with Dragons & Dungeons to be safe. -
Ah, cheers for explaining! I think I got it =)
-
I have another question. I could use a hint for how to calculate if player1 is next to player0 and if less then 5x/y a sound is played. I've tried all I could think of, so I believe I'm in the need to learn something completely new to handle this. This is as far as my basic understanding of these things go and it's no good: if player0x=player1x5 then o=10 So in short, how do I go about checking for player1x/y if it's next too player0x/y?
-
Is this brand off limits or can I use it? Or am I better of using a spoof name?
