30 November 2020, 13:25 | #1 |
Registered User
Join Date: Oct 2019
Location: Eydelstedt / Germany
Age: 44
Posts: 114
|
energy bar
Hi,
for my little spacewar-like game, i want to draw a bar for each space ship which gives information about the remaining energy. What approach would you guys use? I think there must be several: - just write a method for setting the pixels - using the blitter in line mode and fill the corresponding area - use the copper to change colors in the corresponding lines - ... Greetings Christian |
30 November 2020, 17:51 | #2 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,454
|
Generally, I think I'd opt to draw the bar in some fashion (either directly setting the pixels on the bitmap or by using HW sprites and changing them). If the bar is very accurate and the changes are usually small, it might even be faster to use the CPU to update the image*. If the bar is updated in larger chunks instead, I'd probably just store some bitmaps containing the various bar chunks and blit them.
I'd probably not bother with line mode (it's not likely to be any faster than other forms of blitting, but is more tricky to set up). Copper is interesting, but probably limits you quite a bit in size/precision of updates. *) Very small drawing operations are faster with th1e CPU because the overhead of setting the Blitter registers can be avoided. Do note this is only true for very small updates - it'll become faster to use the Blitter instead quite quickly once the updates become bigger. |
02 December 2020, 08:38 | #3 |
Registered User
Join Date: Oct 2019
Location: Eydelstedt / Germany
Age: 44
Posts: 114
|
Thanks. Decided to draw it by setting the pixels directly. Works perfectly. I attached a screenshot of my game so far.
|
02 December 2020, 10:33 | #4 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,454
|
Nice, looking forward to more updates
|
02 December 2020, 12:36 | #5 |
Registered User
Join Date: Oct 2019
Location: Eydelstedt / Germany
Age: 44
Posts: 114
|
I made a short video of the gameplay (.avi in zip-file). Thats how it looks like at the moment. The energy bar moves around just for testing. Next step is to implement its function (damage of ships)....and to implement some kind of explosion when the energy is zero.
|
02 December 2020, 13:42 | #6 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,454
|
Nice, it's very smooth in both movement and rotation. Looks like it could be good fun once completed.
|
02 December 2020, 15:24 | #7 |
Registered User
Join Date: Oct 2019
Location: Eydelstedt / Germany
Age: 44
Posts: 114
|
Thanks a lot! To have fast and smooth movements is my main goal. I thinks it is a precondition for having fun with a space shooter game like this.
|
03 December 2020, 21:35 | #8 |
Registered User
Join Date: Mar 2018
Location: Rome
Posts: 173
|
As already said by roondar, animations are smooth and fast as well, very good. I wonder if gameplay may be similar to Star Control, one of my favourite games for amiga and pc. Does it run on Amiga 500?
Good job! |
03 December 2020, 22:06 | #9 |
Registered User
Join Date: Oct 2019
Location: Eydelstedt / Germany
Age: 44
Posts: 114
|
Thanks. Yes, it runs on A500. I am coding this game on an A500 using ASMOne v1.15. And sometimes in WinUAE using a backup of my A590 hard disk.
|
03 December 2020, 22:19 | #10 |
Registered User
Join Date: Sep 2017
Location: Kansas, USA
Posts: 329
|
As for the original topic of health bars: If you can use a vertical health bar, sprites are another option.
|
03 December 2020, 22:59 | #11 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
|
04 December 2020, 08:22 | #12 |
Registered User
Join Date: Oct 2019
Location: Eydelstedt / Germany
Age: 44
Posts: 114
|
In the status panel area, no sprites are used at the moment. Only the space ships are attached sprites with 16 colours. I agree, I could of use attached sprites for the health bars too. For the moment i'll use the existing approach because it is simple and works.
|
04 December 2020, 10:19 | #13 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,454
|
For a vertical energy bar, you could also use non-attached sprites: simply use the Copper to change the colour register(s) that corresponds to the bar being shown.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Purple bar in WB | Dustyarddog | support.Hardware | 2 | 13 February 2020 09:19 |
pure energy disks | alienkidmj12 | request.Apps | 1 | 26 August 2019 22:58 |
Energy (Holodream) | Heavy Stylus | request.Old Rare Games | 4 | 25 April 2013 13:11 |
LED Bar(s) | Charlie | support.Hardware | 3 | 12 October 2009 22:55 |
Blues Brothers trained +17 by Energy | bobbybearing | request.Old Rare Games | 0 | 27 November 2006 18:23 |
|
|