Digging

Post Reply
User avatar
Electric cat
Posts: 155
Joined: Sun Oct 07, 2018 4:09 am

Digging

Post by Electric cat » Thu Apr 04, 2019 10:52 pm

Hello all,

I was thinking on adding a shovel to dig with in my game and thought Hmm how would that work?

the Shovel would be and extra weapon (effect) then it would have to connect to a tile type so when you got the right tiles so I guys it could be used as a breakable block ? But I would like it where you can walk over it like in Legend of zelda strike it with your shovel to reveal a prize.

So you would have to turn solid collision off for the block? But then what issues would that create?

Thanks for reading
Code Name : Silencer (WIP)
Legacy Of Black(WIP)
User avatar
rimoJO
Posts: 253
Joined: Sat Jan 12, 2019 2:23 am
Location: Planet Earth

Re: Digging

Post by rimoJO » Fri May 10, 2019 7:54 pm

i don't know...
Mystery Game status: Currently at least one in development. Stay tuned!
User avatar
Bucket Mouse
Posts: 428
Joined: Wed Mar 07, 2018 2:25 am

Re: Digging

Post by Bucket Mouse » Sat May 11, 2019 7:02 am

You're on the right track. It would simply be a breakable block but both states would be non-solid. You'd map the shovel to a button; the code would say that if you pressed the button over that specific tile, the tile would change to the "Dug" version. This would take some ASM tinkering, especially if you want prizes to appear at random -- that'd be more complicated.

Note that the holes you dig would undo themselves if you walked offscreen, but that was the case in Zelda too.
User avatar
TolerantX
Posts: 68
Joined: Fri Jan 18, 2019 7:58 am

Re: Digging

Post by TolerantX » Wed Jul 15, 2020 10:59 pm

just an idea. couldn't you make a block that is destroyed by weapon object maybe 3 for example. and have the weapon animate under the player (input that triggers on pressing down AND A or B which ever button you assign to it)?
User avatar
mouse spirit
Posts: 315
Joined: Tue May 12, 2020 1:13 am
Location: Ohio,North America
Contact:

Re: Digging

Post by mouse spirit » Thu Jul 16, 2020 4:43 pm

Right. A breakable block(tile) that you can walk on and only breaks if using shovel.
So maybe combine a breakable tile script, make that asset or tile walkable, also in the script say but
only break when using player object...3 or something.Now have player object 3 be the shovel and have it as you current weapon.


This is from a 4.1.5 script,just an example

Code: Select all

;; ASSUMES PROJECTILE or BREAKER OBJECT is #$03

;;; SOLID
;;;This is how to inform a solid collision.
;;; You can also add this to the end of
;;; any tile type if you want it to have an effect AND
;;; be treated like solid.
;;; You could also check to see if it is a non-player object,
;;; and only return solid if it's a not player.  This would
;;; cause monsters to treat things like spikes or ladder or fire
;;; as solid while the player is able to interract with it.





	;LDA #TILE_SOLID
	;STA tile_solidity
	
	;; if you want it solid, declare it at the end
	LDA Object_type,x
	CMP #$03 ;; is a projectile?  Change this is you want to use a different object #.
	BNE dontBreakThisBlock
	
	
	ChangeTileAtCollision #$00, underStomp
	;PlaySound #SFX_BREAKABLE_BLOCK
	
	
dontBreakThisBlock:
I am game, hear me blip.

WIP my game Star Rider
https://www.mediafire.com/file/phef252j ... p.zip/file
Post Reply