Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: new to using sprites  (Read 5910 times)

0 Members and 1 Guest are viewing this topic.

rednova

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 225
    • http://www.feryogi.com
new to using sprites
« on: August 21, 2015, 12:18:38 AM »

Dear Amos Friends:

I have no experience using sprites and bobs.
I am looking forward to learn, as I want to make new amos games
that use sprites.
Any tips for a newbie ?
Logged
-mobilis in mobile-

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: new to using sprites
« Reply #1 on: August 21, 2015, 10:22:52 AM »

Sprite graphics use colors 17 to 31 in the palette even if the screen uses fewer than that.  You can only have four of them horizontal from each other unless you use fewer colors.  They cannot be wider than 16 pixels wide without stacking them horizontally.  The first color entry is always transparent and the lower numbered sprites overlap the higher numbered ones.

Bobs are slower than sprites but use the whole screen palette.  The bigger they are, the slower they get.
Logged

Lonewolf10

  • AMOS Extensions Developer
  • AMOS Dev
  • A2000
  • *****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 618
    • http://www.aliensrcooluk.com
Re: new to using sprites
« Reply #2 on: August 23, 2015, 05:00:11 PM »


To elaborate a little...

For 4 colour sprites, colours 17,21,25 and 29 will be the ones used for transparency.

For 16 colour sprites colours 17 and 25 will (I think) be used for transparencies.

Also, there is no limit on how tall a sprite can be (although they are rarely larger than the screen).


I hope you have fun playing with Sprites :)
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: new to using sprites
« Reply #3 on: August 23, 2015, 05:31:02 PM »

@Lonewolf10
Your numbers are not correct.  The transparent background shows through 16 because you're supposed to start with zero as the first entry.

Also, sprites aren't arbitrarily tall.  The maximum height is 126 pixels.  This is due to the way sprites are stored in memory.

@rednova
For 3 color sprites, entries 17, 18, and 19 work on sprites 0 and 1.  Colors 21, 22, and 23 work on sprites 2 and 3.  Colors 25, 26, and 27 work on sprites 4 and 5.  Colors 29, 30, and 31 work on the last two sprites, 6 and 7.

I'd avoid using 3 color sprites for now though.  It only lets you use twice the amount of sprites.
« Last Edit: August 23, 2015, 05:34:42 PM by SamuraiCrow »
Logged

KevG

  • A600
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 87
Re: new to using sprites
« Reply #4 on: August 24, 2015, 04:27:54 PM »

You can use 'Set Sprite Buffer 256' to change the height of your sprites to the same height as a PAL screen.

Also, you can layer 3 colour sprites on top of each other to create more colours in your image.

On another note, its nice to see people getting back into AMOS again.
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: new to using sprites
« Reply #5 on: August 24, 2015, 06:44:57 PM »

That's not how it works.  Computed sprites copy all of the uses of a sprite channel into one buffer.  The first line contains information about the coordinates and height of the sprite in rows.  Since the height is 7 bits and the result must be even, 126 is the maximum height of a sprite image.

AmosPro will automatically stack sprites to make them appear bigger than possible in the hardware.  This comes at the expense of additional sprites.
« Last Edit: August 24, 2015, 06:52:08 PM by SamuraiCrow »
Logged

Lonewolf10

  • AMOS Extensions Developer
  • AMOS Dev
  • A2000
  • *****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 618
    • http://www.aliensrcooluk.com
Re: new to using sprites
« Reply #6 on: September 03, 2015, 08:41:49 PM »

@Lonewolf10
Your numbers are not correct.  The transparent background shows through 16 because you're supposed to start with zero as the first entry.

Ack! That always catches me out.

Thanks for the correction :)

Also, sprites aren't arbitrarily tall.  The maximum height is 126 pixels.  This is due to the way sprites are stored in memory.

Is this an AMOS only thing? I have used sprites larger than 126 pixels (in fact it was the height of the screen, so ~250 pixels) before without any known issues in my All Square demo made in assembler.
« Last Edit: September 03, 2015, 08:44:51 PM by Lonewolf10 »
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: new to using sprites
« Reply #7 on: September 04, 2015, 01:19:15 AM »

According to this link to the Hardware Reference Manual, there are actually 9 bits on the VSTOP.  Maybe they can be taller than I thought.
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022