Jump to content
IGNORED

Multisprite guidance


|*BILLY$CLINT*|

Recommended Posts

Okay I am working on the following code that comes with bB trying to get a player and then 5 sprites that the player has to battle. But at the present point in time I can only get two sprites to display, the player and the bad guys. I was reading the manual and it mentioned something about the multisprite kernel but I am not sure how to use it or where to access it from. Is there any one that can let me in on the secret.

 

Currently I am using windows XP service pack 2 and I am running the Crimson Editor 3.70 and bB 1.0. I tried the bleeding edge build but it did not work, i keep getting compile errors so I switched back to the normal version and the following code will compile no problem.

 

I am very new at this and am trying hard to get this so please forgive me if this request for help sounds primitive. Also if you do lend a hand please make comments so that I can see and understand what you did. I want to learn what is going on.

 

set smartbranching on

10 player1x = 40 : player1y = 40: player0x = 50 : player0y = 50

20 COLUPF = 90:missile0height=4:missile0y=255

25 score=10000
30 COLUP0 = 120
35 COLUP1 = 14
40 scorecolor = 10:NUSIZ0=16


45 player0:
%01000010
%11111111
%11111111
%01111110
%00111100
%00011000
%00011000
%00011000
end
46 player1:
%00111100
%00011000
%00011000
%00011000
%11100111
%10100101
%10011001
%00100100
end

47 a = a + 1 : if a < 2 then 55 rem55
49 a = 0

50 if player1y < player0y then player1y = player1y + 1
51 if player1y > player0y then player1y = player1y - 1
52 if player1x < player0x then player1x = player1x + 1
53 if player1x > player0x then player1x = player1x - 1

54 player1x = player1x : player1y = player1y

55 if missile0y>240 then 58
57 missile0y=missile0y-2:goto 59
58 if joy0fire then missile0y=player0y-2:missile0x=player0x+4

59 drawscreen

60 if collision(missile0,player1) then score=score+1:player1x=rand/2:player1y=0:missile0y=255
65 if collision(player0,player1) then score=score-1

70 if joy0up then player0y = player0y - 1
80 if joy0down then player0y = player0y + 1
100 if joy0left then player0x = player0x - 1
120 if joy0right then player0x = player0x + 1

140 goto 30

 

Thanks

 

|*BILLY$CLINT*|

Edited by |*BILLY$CLINT*|
Link to comment
Share on other sites

After looking at your code the way that you did everything makes alot of sense and I can kind of figure it out. But since I dont want to rip it off I have been trying to make my code similar to it but I have run into a wall now all I get is the following error and it will not compile.

 

---------- Capture Output ----------

> "C:\Atari2600\bB\2600bas.bat" C:\Atari2600\bB\samples\NERDSTest

(80) Error: Unknown collision type: (missile0,player2)

Compilation failed.

 

> Terminated with exit code 0.

 

Here is the code. It has a few comments/ question in it that i have made as I went along with things that I dont understand.

 


rem |*BILLY$CLINT*| code use from Crimson Editor for the base of my game 
rem 04.14.07
rem okay first what are the number for I cant figure that out for example
rem "20 COLUPF = 90:missile0height=4:missile0y=255" why does this line start with 20?

1 set smartbranching on
2 set kernel multisprite


COLUBK=64 : rem background color 
COLUP0=46 : rem not know 

10 player1x = 40 : player1y = 40: player0x = 50 : player0y = 50: player2x = 45 : player2y = 

20 COLUPF = 90:missile0height=4:missile0y=255

25 score=10000  : rem score amount 
30 COLUP0 = 120 : rem player color 
35 COLUP1 = 14	: rem badguy color 

40 scorecolor = 10:NUSIZ0=128 : rem this is the score color but not sure what NUSIZ0 is?



 player0:	 : rem this is the player
%01000010
%11111111
%11111111
%01111110
%00111100
%00011000
%00011000
%00011000
end
 player1:		: rem this is the bad guy
%00111100
%00011000
%00011000
%00011000
%11100111
%10100101
%10011001
%00100100
end

player2:	   :  rem this is suppose to be another bad guy 
%00000000
%00000000
%00000000 
%00000000
%00000000
%00000000
%00000000
%00000000
%00000000
%00000000
%00000000
%00000000
%00000000
end


47 a = a + 1 : if a < 2 then 55 
49 a = 0

50 if player1y < player0y then player1y = player1y + 1 : rem I think this is the A.I for the Bad guys 
51 if player1y > player0y then player1y = player1y - 1
52 if player1x < player0x then player1x = player1x + 1
53 if player1x > player0x then player1x = player1x - 1

54 player1x = player1x : player1y = player1y :rem not sure what this is 

55 if missile0y>240 then 58
57 missile0y=missile0y-2:goto 59

58 if joy0fire then missile0y=player0y-2:missile0x=player0x+4 :rem I think this fires and draws the missles
59 drawscreen

60 if collision(missile0,player1) then score=score+1:player1x=rand/2:player1y=0:missile0y=255
61 if collision(missile0,player2) then score=score+1:player2x=rand/2:player2y=0:missile0y=255  :rem this is the player and the Bad Guy collision
65 if collision(player0,player1) then score=score-1
66 if collision(player0,player2) then score=score-1

70 if joy0up then player0y = player0y - 1   : rem this is the joy pad momement 
80 if joy0down then player0y = player0y + 1
100 if joy0left then player0x = player0x - 1
120 if joy0right then player0x = player0x + 1


140 goto 30

Link to comment
Share on other sites

After looking at your code the way that you did everything makes alot of sense and I can kind of figure it out. But since I dont want to rip it off I have been trying to make my code similar to it but I have run into a wall now all I get is the following error and it will not compile.

 

---------- Capture Output ----------

> "C:\Atari2600\bB\2600bas.bat" C:\Atari2600\bB\samples\NERDSTest

(80) Error: Unknown collision type: (missile0,player2)

Compilation failed.

 

> Terminated with exit code 0.

 

Here is the code. It has a few comments/ question in it that i have made as I went along with things that I dont understand. Also, if I remember right, you can't set missile height in the multisprite kernel, you'll have to remove that statement.

 


rem |*BILLY$CLINT*| code use from Crimson Editor for the base of my game 
rem 04.14.07
rem okay first what are the number for I cant figure that out for example
rem "20 COLUPF = 90:missile0height=4:missile0y=255" why does this line start with 20?

1 set smartbranching on
2 set kernel multisprite


COLUBK=64 : rem background color 
COLUP0=46 : rem not know 

10 player1x = 40 : player1y = 40: player0x = 50 : player0y = 50: player2x = 45 : player2y = 

20 COLUPF = 90:missile0height=4:missile0y=255

25 score=10000  : rem score amount 
30 COLUP0 = 120 : rem player color 
35 COLUP1 = 14	: rem badguy color 

40 scorecolor = 10:NUSIZ0=128 : rem this is the score color but not sure what NUSIZ0 is?



 player0:	 : rem this is the player
%01000010
%11111111
%11111111
%01111110
%00111100
%00011000
%00011000
%00011000
end
 player1:		: rem this is the bad guy
%00111100
%00011000
%00011000
%00011000
%11100111
%10100101
%10011001
%00100100
end

player2:	   :  rem this is suppose to be another bad guy 
%00000000
%00000000
%00000000 
%00000000
%00000000
%00000000
%00000000
%00000000
%00000000
%00000000
%00000000
%00000000
%00000000
end


47 a = a + 1 : if a < 2 then 55 
49 a = 0

50 if player1y < player0y then player1y = player1y + 1 : rem I think this is the A.I for the Bad guys 
51 if player1y > player0y then player1y = player1y - 1
52 if player1x < player0x then player1x = player1x + 1
53 if player1x > player0x then player1x = player1x - 1

54 player1x = player1x : player1y = player1y :rem not sure what this is 

55 if missile0y>240 then 58
57 missile0y=missile0y-2:goto 59

58 if joy0fire then missile0y=player0y-2:missile0x=player0x+4 :rem I think this fires and draws the missles
59 drawscreen

60 if collision(missile0,player1) then score=score+1:player1x=rand/2:player1y=0:missile0y=255
61 if collision(missile0,player2) then score=score+1:player2x=rand/2:player2y=0:missile0y=255  :rem this is the player and the Bad Guy collision
65 if collision(player0,player1) then score=score-1
66 if collision(player0,player2) then score=score-1

70 if joy0up then player0y = player0y - 1   : rem this is the joy pad momement 
80 if joy0down then player0y = player0y + 1
100 if joy0left then player0x = player0x - 1
120 if joy0right then player0x = player0x + 1


140 goto 30

I do see one obvious problem in the code, In line 10 you need to put a numeric value at the end, you have an "= <blank> ".

 

Steve

Edited by Atarius Maximus
Link to comment
Share on other sites

I keep seeing more things, sorry for the multiple posts. You'll also have to add this line immediately before the set kernel multisprite line:

 

includesfile multisprite_bankswitch.inc : rem

 

The :rem at the end may not be necessary anymore, it was with the bleeding edge builds.

 

Steve

Link to comment
Share on other sites

Ah, I found one more thing. Sorry, I read through your post so quickly the first time I missed an obvious thing. There is a problem with this code:

 

collision(missile0,player2)

 

You can only specify player0 and player1 in any collision detection statement. Player sprites 2 through 5 are virtual copies of player 1, so the only way to detect a collision with them is to compare the X and Y coordinates of those sprites with the item you're trying to detect a collision with. I had forgotten about that and had to change the code in my Turbo demo that I'm working on -- the player car and oncoming traffic sprites HAD to use player0 and player1 to simplify colliision detection. I've been playing around with the multisprite kernel for a pretty long time, I'll be happy to answer more questions for you if you run into more problems.

 

Steve

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...