The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

Hello, I'm trying to create a game in which the player doesn't have the skills in a hotbar, he has the elemental powers and using their combination certain spells or attacks are cast. The closest I can think of it would be like in Magicka or Magicka 2, having just started with general programming and game creation I can't think of how I could write this in GDScript to make it work, check if the player has the right mana to use (fire, water etc) put the combination in a cast bar and finally release the magic with the click of a button if the combination is correct. Would anyone have a tutorial on this or could instruct me on how to write this script? Ty

in Engine by (24 points)

2 Answers

0 votes

Unless you want all of your spells to be subtle variations of each other, it's a matter of defining all of the combinations.

Start by working on the simplest version of what you want to do. Then iterate on things as you learn and add additional complexity.

For example:

  • Implement casting a spell that costs zero mana.
  • Implement casting a spell that costs one mana.
  • Implement casting a spell that costs one mana of a different type.
  • Implement casting a spell that costs two mana.
  • Implement casting a spell that costs two mana of different types.
  • etc.

There are plenty of tutorials available for how to do things like play an animation, create a particle effect, create UI elements, or handle mouse input. You will have to learn these pieces and put them together to create your game. Consider creating a small learning project for each concept before combining them together.

by (868 points)
0 votes

I am by no means an experienced programmer, but I think that labeling an element as a string e.g "fire" or "ice" and just stuffing them into an array, and then checking the insides of an array to give the end result might work.

by (26 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.