Author Topic: Braces  (Read 15361 times)

0 Members and 1 Guest are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Brackets
« Reply #15 on: June 26, 2010, 01:25:25 am »
True, I could use comments ... too late, anyway. I'm not used to commenting my code, like most people who started with BASIC.




Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Brackets
« Reply #16 on: June 26, 2010, 11:24:49 am »
The only reason I somestimes commentmy code is because of java.  The pointers are the hardest part about axe. If you understand them, and understand the math, you are practically an axe expert.

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: Brackets
« Reply #17 on: June 26, 2010, 01:06:16 pm »
I personally found stuff like dealing with storing stuff to half-bytes and dealing with negative values in comparisons to be harder. Pointers were hard to get at first, but not as much it seems. Learning to deal with negative values is easier, but dealing with them is rather tricky, especially when you do a program with physics and collision detection.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Brackets
« Reply #18 on: June 26, 2010, 05:05:30 pm »
i think negative values are easy to understand, just tough to implement. also, getting sin cos and tan are difficult. i still don't understand bitmap(). but i don't use it either.


Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: Brackets
« Reply #19 on: June 26, 2010, 05:56:59 pm »
I really like the bitmap() command. I haven't used it jet, but that's because I'm also programming in c#, which has a little priority right now for me for this week. next week I'll start to code intensively in Axe. But the bitmap command is just like the sprite command, except the first two bytes: they are the height and width. After them comes the data in bits, so a little smiley of 9 x 9 would look like this:

10011001
000111000
011000110
100101001
101010101
100000001
101000101
100111001
011000110
000111000
in bytes, which is in hex: 09091C31A535580D1672C61C0

I thougt. please correct me if I'm wrong!
« Last Edit: June 26, 2010, 06:01:09 pm by LordConiupiter »
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Brackets
« Reply #20 on: June 26, 2010, 05:59:10 pm »
i think that's wrong, but i'm not completely sure. it's 9x9 so wouldn't 0909 be the first two bytes in the hex?


Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: Brackets
« Reply #21 on: June 26, 2010, 06:00:36 pm »
yes, ure right, I'll correct that!
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Braces
« Reply #22 on: June 26, 2010, 06:16:14 pm »
Also, you're going to have to pad to the nearest byte.  Which means that your sprite will look something like this:

0909
Row1: xxxxxxxx x0000000
Row2: xxxxxxxx x0000000
...
Row9: xxxxxxxx x0000000
So in total, the sprite will be 20 bytes.  2 for the size parameters and 18 for the sprite itself.
« Last Edit: June 26, 2010, 06:16:39 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Braces
« Reply #23 on: June 26, 2010, 06:30:07 pm »
000110010
000111000
011000110
100101001
101010101
100000001
101000101
100111001
011000110
000111000

is [090919001C0063009480AA808080A2809C8063001C00]
i just tried it on calc and it works.


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: Braces
« Reply #24 on: June 26, 2010, 11:37:41 pm »
So does the width have to be a multiple of 8 like most sprite routines?
« Last Edit: June 26, 2010, 11:38:18 pm by DJ Omnimaga »

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Braces
« Reply #25 on: June 27, 2010, 01:07:11 am »
no the width does not have to be specified as a multiple of eight, but when converting the sprite to hex you have to pretend that the width is a multiple of 8. so if you had a 9x9 black square:
111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111
you would specify the dimensions as 0909 in the first two bytes. however, the sprite you convert to hex would look like so:
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000
because you have to pad to the nearest byte, or multiple of eight.
the hex for a 9x9 square would thus be:
[0909FF80FF80FF80FF80FF80FF80FF80FF80FF80]


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: Braces
« Reply #26 on: June 27, 2010, 01:09:14 am »
Aaah ok, so it's kinda like when you make sprites with xLIB, then. To draw a 14x8 sprite, you need to draw a 16x8 one with the last two columns of pixels being turned OFF.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Braces
« Reply #27 on: June 27, 2010, 07:50:03 pm »
Do they have to be turned off, or are they simply ignored?




Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Braces
« Reply #28 on: June 27, 2010, 07:51:18 pm »
I'm almost certain that they're ignored, but I haven't actually tried that yet.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Braces
« Reply #29 on: June 27, 2010, 07:53:39 pm »
They have to be off in your sprite, since xLib accepts sprite width in bytes.
The sprite would only be drawn to be 14 pixels wide, but you would have to space it 2 pixels away from the next sprite, then when you called real(1, you would give it a sprite width of 2 bytes. This would draw a 16 pixel wide sprite, but since 2 of the columns were white, or the pixels were turned off, it would appear to be a 14x8 sprite.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.