English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 21 April 2020, 00:01   #1
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
How to do multiple copperlists

So Flappy Bird is coming along nicely but I would like to have two copper lists on one screen so I can have a few extra colours and use sprites for score without taking sprites from the main game. I think this is possible.

I have main screen of 320x199 dual playfield and then want an additional section below this to the bottom of the display. I know I have to leave a line(?) between copper lists so I guess the bottom section will be 320x55?

My problem is once I have define the 2 copper lists I know I need to use Create Display to join the copper lists but I am then confused how to use these with my bitmap?

All my attempts have failed and just don't understand how this works?

Help!!!
Havie is offline  
Old 21 April 2020, 12:55   #2
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,381
You have to think of the coplists as separate screens entirely, like pulling the Workbench screen down to reveal DeluxePaint behind (which is the same mechanism internally anyway). They can't overlap, and I think you might actually need 2 or 4 lines in between them, depending on the format of the first coplist.

As for joining them, don't think about it that way. Just think of them as two entirely separate displays, each with its own bitplane setup, palette and bitmaps. Use the CreateDisplay command to show both coplists, but then you need to have an entirely separate bitmap to display on the second coplist. This should match the format of the second coplist (depth etc.), not the first. You can display the bitmap using the DisplayBitmap command and specifying Coplist 1 (or whatever) instead of Coplist 0. For a status panel, you don't need to redraw it every frame, and probably don't need double-buffering, so it can be kept pretty simple.

All the sprites are available again with the second Coplist's palette, but they can't be moved over the first Coplist, so I don't think there's much advantage to doing it that way. Instead, just draw your information to the second bitmap directly, save the extra steps involved.
Daedalus is offline  
Old 21 April 2020, 13:29   #3
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
That makes it clearer -thanks. I was sort of on the right track (I think).

Plan to use sprites to display score so this will be fine although in reality I may not need a separate copper list for this - depends how I do the moving pipes.

Collision has turned out to be simple as I can use sprite to blitplane collisions so only 3 lines of code needed (I cleverly have a one colour border around the pipes).

But..it would seem to me that as I am basically using very little cpu time - hardware scroll and sprite for the bird that I can probably use blitting for the moving pipes and keep the collision detection exactly as it is. This would therefore free up the left over 7 sprites which is more than enough for the score.

On the other hand, the additional copper list will give me access to a few more colours which could come in handy!!!

Decisions, decisions...
Havie is offline  
Old 25 April 2020, 01:38   #4
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Got the 2nd copper list working and if I use it and put score at bottom then it frees up sprites to use to detect if you have passed a pipe for score purposes.

Not sure if the gap looks right though? May have to use blits for the score to free up sprites or find a different way of working out that you have passed a pipe?

Whp'd have thought that it would be so complicated...or maybe it's just me?
Havie is offline  
Old 25 April 2020, 09:24   #5
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,381
Can you not just base it on a simple collision box model? The pipes are essentially rectangles, so you only need to check if it's past the centre of the pipe + half the width + half the width of the bird (and the offsets can be precalculated since the sizes don't change).
Daedalus is offline  
Old 25 April 2020, 10:54   #6
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Yes - have dreamt about it and realise that I'm getting sprite obsessed. My thoughts sre similar - every time I create a I create a value in a pipex array storing the pipe x coordinate. I then decrease this every frame and when the pipe = birdx then score a point Simples! No need for anything more complicated because if the bird hits the pipe it dies and if it keeps flying then kit must have passed through the pipe!

No more split copper list needed!

Have to say that even though this was initially a couple of days update - I'm learning lots and hopefully improving my skills?

With a bit of time today - may have a first demo properly up and running.

Seem to do my best thinking in bed!
Havie is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copperlists and screen sizes Jherek Carnelia Coders. Asm / Hardware 2 12 November 2019 18:59
Multiple Copperlists and Sprites Havie Coders. Blitz Basic 4 03 October 2018 21:10
multiple use of traps Galahad/FLT Coders. General 2 27 November 2014 10:53
multiple screenshots otro support.WinUAE 6 25 November 2005 20:56
multiple HDFs BippyM request.UAE Wishlist 1 24 September 2005 23:12

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:27.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07532 seconds with 13 queries