Need Help Getting Basic Mechanics Started (2D Puzzle Platformer)
Hi all, first time asking a Question so hopefully someone can push me in the right direction or even help out :)
2D Game am working on has will work on a 16x16 grid of box colliders, with the intention of many levels made of modular blocks etc.
Need to implement a Charge mechanic on my Player Character.
Charge will deplete for every Grid Square moved through, need public Int Variables for both Charge and Squares moved through in order to tweak them around.
Need a way to make Certain Grid Squares ADD Charge and also DEPLETE Charge (for use in powering interactables, will worry about this later)
And finally, When Charge =< 0, Destroy and Instantiate Game Object.
Any help would be greatly appreciated as I have totally hit a Roadblock here.
That's what I get for sticking to the Art Side of Games Design xD.
Cheers.
Your plan sounds good. Now it just needs to be implemented.
Depending on how the character moves along the grid, fixed positions or free roa$$anonymous$$g, there are several ways to accomplish this. The simplest way may be with colliders (OnCollisionEnter, OnCollisionExit, etc). Start by making a script for the player, it will store the current charge amount. Then make script for the squares, it will have an int that deter$$anonymous$$es if the players is getting/losing charges, and add the collision logic.
Can't help more than this, try scripting it first and if you get stuck, paste the code and describe the problem you are encountering.
Your answer
Follow this Question
Related Questions
"Invalid argument"? 0 Answers
How to fix spite character changing position when turning? 1 Answer
Does anyone know how to make an object(enemy) follow a path set by the player in a 2D side scroller? 1 Answer
How do you Isolate Physics2D.OverlapArea to a single script/gameObject/Instance? 0 Answers
Player Not Moving With Platform 2D 1 Answer