Posts: 2,020
Threads: 24
Joined: Jun 2002
...the latest rellib beta can load pcxs. *shuts up*
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Posts: 131
Threads: 10
Joined: Oct 2002
thanks wiz
·····································LINEAR INC·····································
Ã-----------------------------------------------------------------------O
From Problem to Solution - We take the shortest distance
Posts: 131
Threads: 10
Joined: Oct 2002
I did it right this time. Verbatim nathan. It's not working.
Here are the new files I used. I'm not sure what's going.
http://www.geocities.com/kofman2155/ TRYINGAGAIN.zip
Here is the updated code for it:
Code: DEFINT A-Z
SCREEN 13
CLS
' THE FOLLOWING PEACE OF CODE IS THE RENDERER I GUESS SO THAT THE SPRITES ARE LOADED INTO MEMORY
DIM sprite(65, 66 + 66) AS INTEGER
OPEN "SPRITE1.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
' THE PALLATE BEING LOADED
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
' STILL KEPT THIS WHICH SEEMS USEFUL
FOR a = 0 TO 63
PSET (a, 0), a
NEXT
' NEXT I DID THE SAME LOADING PROCEDURE FOR THE MASK
DIM mask(65, 66 + 66) AS INTEGER
OPEN "MASK1.TIL" FOR BINARY AS #2
length = LOF(2) - 768
FOR sprt% = 0 TO (length / 66) - 1
mask%(0, sprt%) = 64
mask%(1, sprt%) = 8
FOR byte% = 2 TO 33
GET #2, (sprt% * 66) + 3 + ((byte% - 2) * 2), temp%
'PRINT temp%
mask%(byte%, sprt%) = temp%
NEXT
NEXT
' PAINT (100, 100), 1
'***********
'THIS PART IS JUST TWO FUNKY LOOPS THAT DISPLAY THE SPRITES FROM MEMORY.
FOR z = 0 TO 1
FOR drawx = 0 TO 21
IF z = 0 THEN
a = 0 + 1
b = 2 + 1
ELSE
a = 3 + 1
b = 5 + 1
END IF
FOR drawy = a TO b
PUT (drawx * 8, drawy * 8), mask(0, masknum), AND
masknum = masknum + 1
NEXT drawy
NEXT drawx
NEXT z
FOR z = 0 TO 1
FOR drawx = 0 TO 21
IF z = 0 THEN
a = 0 + 1
b = 2 + 1
ELSE
a = 3 + 1
b = 5 + 1
END IF
FOR drawy = a TO b
PUT (drawx * 8, drawy * 8), sprite(0, spritenum), XOR
spritenum = spritenum + 1
NEXT drawy
NEXT drawx
NEXT z
DO: LOOP UNTIL INKEY$ <> ""
CLOSE #1, #2
·····································LINEAR INC·····································
Ã-----------------------------------------------------------------------O
From Problem to Solution - We take the shortest distance
Posts: 6,419
Threads: 74
Joined: Mar 2002
You did wrong the masks. You are using colour #255 for solid zones and colour #231 for transparent zones. You oughta use colour #0 for solid zones and colour #255 for transparent zones.
Also, the sprites are using colour #255 for transparent zones, and they should be using colour #0.
I've fixed the PCXs and it works just fine, so the only problem is that you mischosen the colour indexes.
Posts: 720
Threads: 46
Joined: Oct 2001
www.angelfire.com/wizard/pigeoncarrier/trythis.zip
You may have to change the file references. I've changed it so that it uses 16x24 sprites... this is more appropriate for your situation, I think.
Try it and tell me what you think.
Posts: 131
Threads: 10
Joined: Oct 2002
Thanks wiz, I fixed the trial that followed the sprite which after that isn't much of an achievement I mean it was simply a LINE (0,0)-(320,200),0,BF but hey it was something. Their are flickering errors bellow 200 pixels. I'm too sure what's wrong with that. I love your whole gravity concept it's really creative. Looks like you took out the buffer, I thought that was the source of the flickering above bellow 200 pixels but apparently not cuase after I put it back into the program it still had problems in that same area. Thanks for reorganizing the pallate for me i would have never done it on my own.
Took a few tries and a little help from a friend to get the clipping just right. Right now I'm doing animation cycles and trying to figure out the logic behind it
For example I'm going to assign each fram to a variable for example
stand1 = 0
stand 2 = 1
..
...
..
kick2 = 12
and so forth.
I thought that would help me organize and cycle better.
I can't think of how to make it cycle between frame 0 and one when it's moving either left or right
I tried a basic IF
IF action = 0 THEN action = 1
IF action = 1 THEN action = 0
For some reason it didn't work
I'm a little confused on why
oh that's right I had it put like this
PUT (x,y), sprite(0,action), PSET
well it wasn't PSET, and there was more to it. You know the drill. But the concept was that. And in my mind it should have worked. What the hell am I doing wrong here. I mean this is just a general breathing routine. I haven't done kicks and punches yet.
Also thanks allot for puting in acceleration and things like that. I'm definatly going to save the code but I'm going to need to change it to make it stop when the key is let go. After all it is a supposed to be a fighting game.
·····································LINEAR INC·····································
Ã-----------------------------------------------------------------------O
From Problem to Solution - We take the shortest distance
Posts: 594
Threads: 11
Joined: Oct 2002
Make it like this:
Code: If action=1 then
action=0
Elseif action=0 then
action=1
End If
Because in your code, when action is equal to zero, action will be set to one, and after that there's the second if clause which makes it to zero again. So it doesn't change at all...
B 4 EVER
Posts: 6,419
Threads: 74
Joined: Mar 2002
Code: action = ABS(NOT action)
does just the same
Posts: 1,166
Threads: 62
Joined: Apr 2003
Or you could make it the nice one-liner way:
Code: IF action = 1 THEN action = 0 ELSE action = 1
am an asshole. Get used to it.
Posts: 720
Threads: 46
Joined: Oct 2001
Quote:I'm going to need to change it to make it stop when the key is let go. After all it is a supposed to be a fighting game.
Even if the acceleration is very slight, it should be there. You can use the constants at the top to tweak that. Ideally, you should load different attributes for different characters, but I don't think you have time for that right now.
For decelleration, simply subtract from the plrXchng value a decelleration constant every cycle:
CONST decel = 0.1
if plrXchng > 0 then plrXchng = plrXchng - decel
if plrXchng < 0 then plrXchng = plrXchng + decel
Alternatively:
plrXchng = plrXchng * 0.9
|