Qbasicnews.com
Starting a fighting game - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html)
+--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html)
+--- Thread: Starting a fighting game (/thread-671.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16


Re: Fascinating... - wizardlife - 05-10-2003

Quote:I'll try to download your .TIL file and your program tomorrow/later tonight. This just can't be a big problem.


Well, I clicked on your "here" link, above, to download your .TIL file and nothing useful happened.

That file had 9x9 sprites. He's got a new one with 8x8. The pascal version of the code allocated memory dynamically, so it didn't matter what size they were... but his code has to be hardcoded to a specific size.


Starting a fighting game - Kofman - 05-11-2003

Well I've uploaded the new sprite I couldn't find my friend but I got it up on a geocities server.

http://www.geocities.com/kofman2155/NARUTO2.TIL

and also
http://www.geocities.com/kofman2155/RNDR.BAS


Starting a fighting game - Kofman - 05-11-2003

by running the script I have an instict that it's the file


Starting a fighting game - wizardlife - 05-11-2003

Quote:http://www.geocities.com/kofman2155/NARUTO2.TIL

Can't grab that one.


Starting a fighting game - Kofman - 05-11-2003

http://www.geekshelter.com/naruto/NARUTO2.TIL


Starting a fighting game - wizardlife - 05-11-2003

got it:

Code:
SCREEN 13
CLS

DIM sprite(65, 38) AS INTEGER

OPEN "NARUTO2.TIL" FOR BINARY AS #1

length = LOF(1) - 768

FOR sprt% = 0 TO (length / 66) - 1

   sprite%(0, sprt%) = 64
   sprite%(1, sprt%) = 8
    
   FOR byte% = 2 TO 33
      GET #1, (sprt% * 66) + 3 + ((byte% - 2) * 2), temp%
      'PRINT temp%
      sprite%(byte%, sprt%) = temp%
   NEXT
NEXT

FOR drawy = 0 TO 12
   FOR drawx = 0 TO 2
      PUT (drawx * 8, drawy * 8), sprite(0, drawy * 3 + drawx), PSET
   NEXT
NEXT


'Just so we can see the palette
FOR a = 0 TO 255
PSET (a, 0), a
NEXT


'LOAD IN THE PALETTE

length = length + 1
DIM colorval AS LONG

FOR col = 0 TO 255
   GET #1, length + (col * 3), R%
   GET #1, length + (col * 3) + 1, G%
   GET #1, length + (col * 3) + 2, B%

   R% = R% AND 63
   G% = G% AND 63
   B% = B% AND 63

   colorval& = R% + (G% * 256) + (B% * 65536)

   PALETTE col, colorval&
NEXT


DO: LOOP UNTIL INKEY$ <> ""


CLOSE #1

In the standard palette, the colours you used are very dark. So loading the custom palette was the trick. I highly recommend that you pick a standard palette that's more sensible than the one you're using here. You can have PSP convert an image into whatever palette you want, of course... what it did here was just arbitrarily assign the colours to different numbers without any organization at all.


Starting a fighting game - Kofman - 05-11-2003

Oh I think I see


Starting a fighting game - Kofman - 05-11-2003

I copied and pasted the program isn't working for me. It's breaking at the put statement


I got the same thing when I fixed your original problem... - Glenn - 05-11-2003

(I knew it was simple; I should've seen it before. You were *using* a SPRITE% array but *DIMming* a SPRITE array. Changing "SPRITE" to "SPRITE%" in the DIM statement fixed your initial problem, which I believe wizardlife had also mentioned.) In your PUT statement, sprt * 18 + 1 gets to be 325 and PUT has a problem with that (it's > 319).


Starting a fighting game - Kofman - 05-11-2003

It works now

Very nice