Author Topic: Sprites, Please?  (Read 29617 times)

0 Members and 4 Guests are viewing this topic.

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: Sprites, Please?
« Reply #45 on: September 23, 2010, 12:07:55 am »

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Sprites, Please?
« Reply #46 on: September 23, 2010, 12:09:40 am »
The programs I am talking about (pic to line) are like these:
http://www.ticalc.org/archives/files/fileinfo/379/37930.html
http://www.ticalc.org/archives/files/fileinfo/231/23126.html

Thanks, meishe.  Did you have to resize the bitmap?  When I tried, the quality on calc was greatly dimished.

All I did was change the palette size, not the image size. That way the image stays the same but you get the correct dimensions.

Edit:
Ok, got the program I said I would create ready now. It didn't take long to create, just didn't start until late. Anywho, here it is.

Note:
All "Ls" and "Es" in these code sets are the scientific notation E and the little list header thing L.

Code: [Select]
Prompt X,Y,W,H
1→D
For(A,Y,Y+H-1
For(B,X,X+W-1
If pxl-Test(A,B
Then
BE6+AE4→K
Repeat not(pxl-Test(A,B
B+1→B
End
K+E2B-E2+A→LP(D
D+1→D
End
End
End

X and Y are the coordinates at which the sprite starts. H and W are the width of the sprite. This program, if you hadn't looked yet, exports the coordinates of a line into one element per line in LP. If you want an actual program that will actually put each line in a Line( command, I could probably whip something up. This just seemed like you were going to do so that's why it is in a list.

The program I used to check that program was this:

Code: [Select]
ClrDraw
For(A,1,dim(LP
LP(A
Line(iPart(E2fPart(Ans/E8)),-iPart(E2fPart(Ans/E6)),iPart(E2fPart(Ans/E4)),-iPart(E2fPart(Ans/E2
End

Hope some of this helps you.

Edit:
Little screenshot of everything working.



Note:
That program I suggested to you to move the sprite will work but with a couple tweaks. The file that is there is currently broken, I don't know how it happened, and I need to fix it. But I think it is just a few DelVar commands that need to be tokenized at the top of the program and a space needs to be placed after the quote to be put into Str1. Oh, and just make sure what ever picture you are using is in Pic1.

Edit:
Note:
Something I should also mention is that I created these programs with the graph window of:

Xmin: 0
Xmax: 94
Ymin: -62
Ymax: 0
Xscl: 1
Yscl: 1
« Last Edit: September 24, 2010, 09:56:20 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Sprites, Please?
« Reply #47 on: September 24, 2010, 08:12:39 pm »
*Bump*

Not sure if many people, especially MRide, saw this since I updated it all. Did it help any?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

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: Sprites, Please?
« Reply #48 on: September 24, 2010, 08:31:42 pm »
For such edits I really recommend bumping with new posts when it has been longer than the double-post limit, since they can easily get missed.

Btw that looks quite nice, the sprite at the end of the screenshot seems to appear much faster :)

Offline MRide

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 711
  • Rating: +14/-0
  • You can't see this.
    • View Profile
Re: Sprites, Please?
« Reply #49 on: September 24, 2010, 08:33:37 pm »
Sorry, I've been incredibly busy this past week.  My activity will be dramatically decreasing for a while.
Anywho, that looks amazing, meishe.  You've been a big help.  If I get some time over the weekend, I'll work on getting the sprites implemented.  (The rest of the battle system is coming along fine, btw)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Sprites, Please?
« Reply #50 on: September 24, 2010, 08:43:02 pm »
@DJ
Well all those edits were all still within like six hours so I couldn't bump it with a new post since it was still on the new post list or what ever that is called.

Also, what are you comparing the speed at which it is displayed to?

@MRide
Oh, that's a shame :( Also, thanks :) Hope it helps. What graph window are you using in IQ?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline MRide

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 711
  • Rating: +14/-0
  • You can't see this.
    • View Profile
Re: Sprites, Please?
« Reply #51 on: September 24, 2010, 08:47:10 pm »
Same one as you :).  It's pretty standard for games that use graph commands.

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: Sprites, Please?
« Reply #52 on: September 24, 2010, 08:48:45 pm »
I was comparing with the speed earlier in the screenshot, which was pixel by pixel.

ALso sorry to hear MRide, I hope school gives you some more free time again soon for coding x.x

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Sprites, Please?
« Reply #53 on: September 24, 2010, 09:04:46 pm »
Same one as you :).  It's pretty standard for games that use graph commands.

Ya, but some people make zero their Ymin and sixty-two their Ymax, and odd things like that. But cool, I don't have to modify it now :P

@DJ
Ah ok, that's what I thought. They are two completely different things since the first one is part of the copy-paste program I made, which does it pixel-by-pixel, as apposed to just displaying the list that was created. I might remake that program to do it like that instead of pixel-by-pixel.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

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: Sprites, Please?
« Reply #54 on: September 24, 2010, 10:30:03 pm »
Ah ok I see.

Offline Madskillz

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 488
  • Rating: +32/-2
    • View Profile
Re: Sprites, Please?
« Reply #55 on: September 25, 2010, 01:50:55 am »
Quote
Ya, but some people make zero their Ymin and sixty-two their Ymax, and odd things like that. But cool, I don't have to modify it now Tongue
I'm pretty sure I used to do that...
« Last Edit: September 25, 2010, 01:51:06 am by Madskillz »

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Sprites, Please?
« Reply #56 on: September 25, 2010, 02:01:11 am »
Quote
Ya, but some people make zero their Ymin and sixty-two their Ymax, and odd things like that. But cool, I don't have to modify it now Tongue
I'm pretty sure I used to do that...

Oh, um, did I say odd? I meant fantastic :P
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

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: Sprites, Please?
« Reply #57 on: September 25, 2010, 02:01:31 am »
Yeah I remember seeing programs that did that. I prefer -62 Ymin and 0 Ymas because then it's in the same order as with Text( and I just need to use the negative symbol

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Sprites, Please?
« Reply #58 on: September 25, 2010, 02:04:11 am »
Ya, it makes the math a lot easier.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline MRide

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 711
  • Rating: +14/-0
  • You can't see this.
    • View Profile
Re: Sprites, Please?
« Reply #59 on: September 27, 2010, 09:54:38 pm »
Edit:
Ok, got the program I said I would create ready now. It didn't take long to create, just didn't start until late. Anywho, here it is.

Note:
All "Ls" and "Es" in these code sets are the scientific notation E and the little list header thing L.

Code: [Select]
Prompt X,Y,W,H
1→D
For(A,Y,Y+H-1
For(B,X,X+W-1
If pxl-Test(A,B
Then
BE6+AE4→K
Repeat not(pxl-Test(A,B
B+1→B
End
K+E2B-E2+A→LP(D
D+1→D
End
End
End

X and Y are the coordinates at which the sprite starts. H and W are the width of the sprite. This program, if you hadn't looked yet, exports the coordinates of a line into one element per line in LP. If you want an actual program that will actually put each line in a Line( command, I could probably whip something up. This just seemed like you were going to do so that's why it is in a list.

The program I used to check that program was this:

Code: [Select]
ClrDraw
For(A,1,dim(LP
LP(A
Line(iPart(E2fPart(Ans/E8)),-iPart(E2fPart(Ans/E6)),iPart(E2fPart(Ans/E4)),-iPart(E2fPart(Ans/E2
End

Hmm....I just tried and got weird results.  It seems there is something wrong with the second set of coordinates generated.  The right edge is all correct, but it gets really messed up with the second X and Y coordinates.  I have gone over to make sure I've typed the program in accurately.  Are you sure this is the correct code?