Author Topic: Sprites  (Read 6397 times)

0 Members and 2 Guests are viewing this topic.

Offline Axe Programmer

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Sprites
« on: September 17, 2013, 10:54:58 am »
Whats up guys. Axe Programmer here. Does anybody know if you can make bigger sprites than 8x8? I am looking for something ligit, not displaying a bunch of 8x8 sprites together. Thanks.
Axe Programmer ???

P.S. Please include a code if you can...
« Last Edit: September 17, 2013, 10:55:38 am by Axe Programmer »

Offline nikitouzz

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 215
  • Rating: +22/-1
    • View Profile
Re: Sprites
« Reply #1 on: September 17, 2013, 11:33:13 am »
then... you can draw 4 sprite 8x8 for make one sprite 16*16 !
mes records personels :

2x2x2 : 2.18 secondes / 2x2x2 une main : 21.15 secondes / 2x2x2 yeux bandés : 47.59
3x3x3 : 5.97 secondes / 3x3x3 une main : 49.86 secondes
4x4x4 : 1.49 minutes / 4x4x4 une main : 6.50 minutes
5x5x5 : 4.10 minutes / 5x5x5 une main : 18.02 minutes
6x6x6 : 8.10 minutes
7x7x7 : 16.03 minutes
9x9x9 : 58.26 minutes

megaminx : 5.59 minutes / pyraminx : 7.91 secondes / square-one : 1.07 minutes

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Sprites
« Reply #2 on: September 17, 2013, 11:56:11 am »
then... you can draw 4 sprite 8x8 for make one sprite 16*16 !
I am looking for something ligit, not displaying a bunch of 8x8 sprites together.

Anyways, did you have a glance at the Bitmap command ? Read the Commands.html to know how to use it.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Hooloovoo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 225
  • Rating: +22/-0
    • View Profile
Re: Sprites
« Reply #3 on: September 17, 2013, 11:56:46 am »
I think that the Bitmap( command does what you are looking for. Next time RTFM.

I got ninja'd
« Last Edit: September 17, 2013, 11:57:51 am by fortytwo »
"My world is Black & White. But if I blink fast enough, I see it in Grayscale." -tr1p1ea
Spoiler For some of the calcs I own:



(actually I have quite a few more than this, but I don't feel like making bars for them all.)

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Sprites
« Reply #4 on: September 17, 2013, 12:07:17 pm »
Next time RTFM.
I second that. You should consider taking a look at commands.html one of those times.

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Sprites
« Reply #5 on: September 17, 2013, 02:06:54 pm »
the bitmap command will work, but displaying as a group of sprites should be faster, so if speed is required just deal with cating them together.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Sprites
« Reply #6 on: September 17, 2013, 02:08:27 pm »
Quote from: axe readme
Bitmap(X,Y,BMP);​Bitmap(X,Y,BMP)ʳ;​Bitmap(X,Y,BMP,BUF);​Bitmap(X,Y,BMP,BUF,MODE) Key:Tangent(): Draws a bitmap to (X,Y) on the main buffer, back buffer, or specified buffer respectively. The bitmap data should have in order: width (1 byte), then height (1 byte), then the rows of the image padded with zeros to the nearest byte. Mode 0 is "Pt-On" logic and Mode 1 is "Pt-Change" logic. Mode 0 is used if unspecified.

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Re: Re: Sprites
« Reply #7 on: September 17, 2013, 08:36:51 pm »
I think that the Bitmap( command does what you are looking for. Next time RTFM.
although I get your point, the RTFM part is considered rude and frowned upon by Omnimaga rules. There are more polite ways to get your point accross (see examples above).

Offline bored_student

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +3/-0
    • View Profile
Re: Sprites
« Reply #8 on: September 18, 2013, 05:43:11 am »
First you need your Bitmap data.
so for example lets draw a 14x19 bitmap
Code: [Select]
Data(14, 19) -> GDB1
[FFFC                             
first row but the two pixles in the end should be zero (this is because you can't end the row with just half a byte
(this is meant by the "the rows of the image padded with zeros to the nearest byte."
FFFC
FFFC
... now you have three rows of black
complete the 16 other and throw a ] at the end
...
FFFC]

Your Bitmap is now stored at GDB1
To display it just call
Code: [Select]
Bitmap(X,Y,GDB1

I don't use the Bitmap() often, so correct me if I made a mistake somewhere  <_<
« Last Edit: September 18, 2013, 11:55:06 am by bored_student »
Sorry for my bad English, I'm German.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Sprites
« Reply #9 on: September 18, 2013, 06:52:37 am »
Also I once wrote a set of routines that draw bigger sprites with multiple 8*8's. I could make an axiom for it. ;)

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Sprites
« Reply #10 on: September 18, 2013, 09:40:16 am »
First you need your Bitmap data.
so for example lets draw a 14x19 bitmap
Code: [Select]
Data(14, 19) -> GDB1
[FFF3                               
first row but the two pixles in the end should be zero (this is because you can't end the row with just half a byte
(this is meant by the "the rows of the image padded with zeros to the nearest byte."
FFF3
FFF3
... now you have three rows of black
complete the 16 other and throw a ] at the end
...
FFF3]

Your Bitmap is now stored at GDB1
To display it just call
Code: [Select]
Bitmap(X,Y,GDB1

I don't use the Bitmap() often, so correct me if I made a mistake somewhere  <_<
You did, but it's not related to the bitmap command :P You should have used [FFFC] instead of [FFF3] to keep the 2 last pixels off, since C is 1100 and 3 is 0011.

Offline bored_student

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +3/-0
    • View Profile
Re: Sprites
« Reply #11 on: September 18, 2013, 11:59:35 am »
You're right, I did.  ;D

Just corrected it
Sorry for my bad English, I'm German.

Offline Axe Programmer

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Re: Sprites
« Reply #12 on: September 19, 2013, 11:06:00 am »
Thanks to everyone

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Sprites
« Reply #13 on: September 22, 2013, 04:23:51 am »
Well actually it doesn't matter what you have in the last pixels as the Bitmap( command will crop it anyway. ;)
« Last Edit: September 22, 2013, 04:24:13 am by Streetwalker »

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Sprites
« Reply #14 on: September 22, 2013, 04:36:26 am »
Well actually it doesn't matter what you have in the last pixels as the Bitmap( command will crop it anyway. ;)

It does matter. :P For efficiency reasons the routine only keeps track of the byte width (pixel width/8) of the sprite when drawing it, so really it always draws sprites that are some multiple of 8 pixels wide, meaning all 8 bits of the final byte are drawn. That's why the documentation says that the end of each row should be padded with 0 bits, as drawing the extra 0 bits with OR or XOR logic doesn't actually change anything. The fact that the width specifier in the sprite data is in pixels really just for convenience purposes, although I see how it could be misleading.
« Last Edit: September 22, 2013, 04:38:42 am by Runer112 »