Jump to content
IGNORED

Multisprite experimentation


Rabbit 2600

Recommended Posts

I'm fiddling with multisprites, but I can only seem to get player0 and player1 on the screen. What have I done wrong?

 

 set kernel multisprite

player0x = 50
player0y = 50
player1x = 40
player1y = 40
player2x = 60
player2y = 60
Level_1
COLUP0 = $B6
COLUP1 = $AE
COLUP2 = $1E
player0:
%00100100
%00100100
%00011000
%00011000
%01111110
%00000000
%00011000
%00011000
end
player1:
%00000000
%00000000
%10000001
%01111110
%00100100
%00100100
%01111110
%10000001
end
player2:
%00000000
%00000000
%10000001
%01111110
%00100100
%00100100
%01111110
%10000001
end

drawscreen

goto Level_1

Edited by Rabbit 2600
Link to comment
Share on other sites

I dunno if this will work. You need to do collisions with virtual sprites in software.

 

This uses all the temp variables as arguments. You must use them to fill in the boundaries of the missile0 and then the boundaries of the second object you want to test to see if its intersecting.

 

_function softcol_missile0

_rem x1 as missile0x, y1 as missile0y, x2 as temp1, y2 as temp2, x3 as temp3, y3 as temp4, x4 as temp5, y4 as temp6

_if missile0x > temp5 then return 0

_if temp1 < temp3 then return 0

_if missile0y > temp6 then return 0

_if temp2 < temp4 then return 0

_return 1

end

Link to comment
Share on other sites

Hm, do I just copy and paste it, or do I need to edit it in some way? I'm not sure I understood.

 

Nah, I didn't (and continue not to) explain how it works properly. Before you use the function you have to fill out the far x and far y values for missile0 - not just the origin (missile0x & missile0y). Then you have to fill the other temp variables with the origin x and origin y and far x and far y of whatever you want to check for collisions.

 

Again, I'm being a dork and not explaining it properly.

Link to comment
Share on other sites

Hm, how are values for far set up?

 

Normally stuff like missile0x and missile0y just refers to the very top-left edge of the sprite (I think?) for software collision you need to specify the top-left coodinates AND the bottom right x/y values. I'm afriad I'm not good at explaining this because honestly *I'm* having a tough time grasping software collisions :P

Link to comment
Share on other sites

About collisions, how do I set up collisions between missile0 and player2-4?

IIRC Player1 represents all of the players 1-5, so your command "if collision(missile0,player1) then player1x = 255 : player1y = 255" should work for all of them (for the collision part anyway). You might have to repeat the collision command for each player, as in "if collision(missile0,player1) then player2x = 255 : player2y = 255" etc. I'm really rusty so I'm not sure if my comments are correct or not.

Link to comment
Share on other sites

Hm, now things are beginning to happen. I have experimented with the same thing you describe. "if collision(missile0,player1) then player1x = 255 : player1y = 255" Works. But when adding

"if collision(missile0,player1) then player2x = 255 : player2y = 255" both player1 and player2 dissapears.

Link to comment
Share on other sites

Hm, now things are beginning to happen. I have experimented with the same thing you describe. "if collision(missile0,player1) then player1x = 255 : player1y = 255" Works. But when adding

"if collision(missile0,player1) then player2x = 255 : player2y = 255" both player1 and player2 dissapears.

I would try changing the location of player2 to a different location of player1 to see what happens. Something like:

if collision(missile0,player1) then player1x = 255 : player1y = 255 : player2x = 255 : player2y = 245

Link to comment
Share on other sites

Here is the same collision function except for a Sega Genesis dialect of BASIC:

 

declare function rectRect(x1 as integer, y1 as integer, x2 as integer, y2 as integer, x3 as integer, y3 as integer, x4 as integer, y4 as integer) as integer

if x1 > x4 then return 0

if x2 < x3 then return 0

if y1 > y4 then return 0

if y2 < y3 then return 0

return 1

end function

 

x1 is the origin x coordinate for sprite 1

x2 is the far x coordinate for sprite 1

y1 is the origin y coordinate for sprite 1

y2 is the far y coordinate for sprite 1

 

x3 is the origin x coordinate for sprite 2

x4 is the far x coordinate for sprite 2

y3 is the origin y coordinate for sprite 2

y4 is the far y coordinate for sprite 2

 

Basically, the routine checks to see if any of those coordinates intersect. You could remake this soft collision routine in batari BASIC in your own fashion. Maybe that would work better!

Link to comment
Share on other sites

I'll experiment with it and see if I can make something work =)

 

Another question, this time about the playfield. I find it extremely hard to make levels when everything is inverted. I can't even make a box outline, any words on what lines I should focus on?

 

Are you using VisualbB to create your playfields? It has a check box for a mirrored playfield. I gotta admit it IS hard to get used to drawing a mirrored playfield :)

Link to comment
Share on other sites

Yeah, I'm using VBB to make playfield, didn't know it had that feature, thanks =) Made a playfield with the mirror feature, bit only half shows =/

 

I got nothin for ya dude.

 

I just created a new playfield

IMMEDIATLY checked [x] mirrored playfield

Set the Playfield Color to something

Started drawing without issue.

 

Also, to create the sides of a boxed-in playfield, remember you can use PF0 =%11111111 just before the drawscreen command to create a border on the sides.

http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#pf0

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...