multiple weapons...
multiple weapons...
Ok... so, I'm trying to do this:
If(attacking{
If (baseball bat equipped){changeSpriteWeapon}
If (chainsaw equipped){changeSpriteWeapon}
If (2x4 with nails in it equipped){changeSpriteWeapon}
}
Etc
I can only figure
Cmp #$03
Bne not attacking
Cmp bat
Beq got bat
Cmp chainsaw
Beq got chainsaw
Cmp 2x4
Beq got 2x4
Jmp
Got bat:
Cmp #$03
Bne not attacking
ChangeSpriteWeapon
Rts
Got chainsaw....repeat process ?
If(attacking{
If (baseball bat equipped){changeSpriteWeapon}
If (chainsaw equipped){changeSpriteWeapon}
If (2x4 with nails in it equipped){changeSpriteWeapon}
}
Etc
I can only figure
Cmp #$03
Bne not attacking
Cmp bat
Beq got bat
Cmp chainsaw
Beq got chainsaw
Cmp 2x4
Beq got 2x4
Jmp
Got bat:
Cmp #$03
Bne not attacking
ChangeSpriteWeapon
Rts
Got chainsaw....repeat process ?
Re: multiple weapons...
Are you using the sprite base weapon or the melee object one?
What are the names of your variables? How do you get weapon... how do you equip? Or maybe when the player got a weapon it replaces the previous one (so auto equip)?
What are the names of your variables? How do you get weapon... how do you equip? Or maybe when the player got a weapon it replaces the previous one (so auto equip)?
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Re: multiple weapons...
for sprite weapons the easiest way to do that would propably be something along the lines of....
1) make your weapon pickup items all set a variable.
2) change your sprite weapon code in predraw.asm to read that variable, and set the #SPR_WEAPON to a different value based on the variable, and do the same with the weapon size values..
it would be something along the lines of changing:
into:
1) make your weapon pickup items all set a variable.
2) change your sprite weapon code in predraw.asm to read that variable, and set the #SPR_WEAPON to a different value based on the variable, and do the same with the weapon size values..
it would be something along the lines of changing:
Code: Select all
doDrawWeapon:
DrawSprite temp, temp1, #SPR_WEAPON, temp2, spriteOffset
JMP doneDrawingWeaponSprite
Code: Select all
doDrawWeapon:
LDA whateveryourweaponvariableiscalled
CMP #$00
BEQ drawweapon1
CMP #$01
BEQ drawweapon2
; do this for as many weapons you have
RTS
drawweapon1:
LDA #$00 ; set this to the number of the first weapon you want to draw
STA #SPR_WEAPON
DrawSprite temp, temp1, #SPR_WEAPON, temp2, spriteOffset
JMP doneDrawingWeaponSprite
drawweapon2:
LDA #$01 ; set this to the number of the second weapon you want to draw
STA #SPR_WEAPON
DrawSprite temp, temp1, #SPR_WEAPON, temp2, spriteOffset
JMP doneDrawingWeaponSprite
Re: multiple weapons...
actually, that wouldn't work because #SPR_WEAPON is a constant. heh... i just pulled that out of my ass....
could do like... make each of your weapons set a variable, but make it set the variable to the value of the weapon you want to draw. (the coordinate of the tile in the tileset, just like you would define the SPR_WEAPON for a single weapon.)
then just change the weapondrawcode to:
this will make it draw the sprite defined in your variable, which is set by the pickup when you get a weapon.
could do like... make each of your weapons set a variable, but make it set the variable to the value of the weapon you want to draw. (the coordinate of the tile in the tileset, just like you would define the SPR_WEAPON for a single weapon.)
then just change the weapondrawcode to:
Code: Select all
doDrawWeapon:
DrawSprite temp, temp1, whateveryourweaponvariableiscalled, temp2, spriteOffset
JMP doneDrawingWeaponSprite
Re: multiple weapons...
Agree with Mugi.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Re: multiple weapons...
At the moment, at least until I figure out an inventory system, gonna have to go with each weapon replacing previous one.
Re: multiple weapons...
For that you could simply make a war like... Numberofweapons or something of the sort and based on the value of it you could make select button (or whatever button) cycle the obtained ones.
Re: multiple weapons...
For a guy who says he ain't a programmer, mugi, you really are saving my ass here dude ! Thanks, Cant want to get on this shit tomorrow.
Re: multiple weapons...
Well, dd is actually the first thing ive put some proper code into :p
Re: multiple weapons...
Something I'm fighting with right now... Any idea how to make the sprite based weapon two tiles ? I'm messing with the predraw width and spriteweapon width, but getting nowhere... ?