Problem is not reproducible or outdated
Programming in 2d games
I'm trying to create a 2D game of my own and I'm strangely finding it a lot harder to do then a 3D game just because everything needs to be programmed unlike in 3D where you can use animation a lot. Of course this isn't a program but there a lot of stuff I find very difficult to program and would some stuff i wouldn't even have a clue on and I'm feeling as if I'm missing something when programming in 2D that makes it a lot easier then how I'm doing it.
What I would like someone to do is to be able to give me an idea on how to program something like this from a game: https://youtu.be/DR1J8IuA65c?t=1m49s (It starts at a certain part)
What I'm talking about is the multiple spikes that turn to face upwards and shoot upwards before being destroyed. I would have no idea on how to program something like that without a lot of timers counting down and even worse I wouldn't have any idea on how to make multiple of the same object next to each other all spawn at once.
Would anyone be able to give me a idea on how i would do something like that? I would be very grateful for the help
Is there a problem with a lot of timers counting down? A single shared timer might be more efficient, but I wouldn't worry about that sort of thing before it's an actual problem.
$$anonymous$$aking multiples of the same object sounds like prefabs to me. Check out this doc page: http://docs.unity3d.com/$$anonymous$$anual/InstantiatingPrefabs.html
It more seems like I'm making my code a lot more complicated to do a simple function then it should be. I don't have a example to show sadly. Though i could be wrong and I'm doing it the way everyone does it XD
Plus if it's simply instantiating prefabs, then how does one do it about 7 times and have each object spawned next to each other?
The link I posted has example code specifically for instantiating prefabs in a row. It's in 3D, but it shouldn't be that hard to translate to 2D.
Yes, you will have to write a bunch of code to make a game, no two ways about it. Yes, being more knowledgeable and experienced will mean you'll need less code to make a game. No need to overthink things, just start throwing crap together and worry about aesthetics later.
Well you could code a Spike$$anonymous$$anager or Trap$$anonymous$$anager that would spawn a spike every X seconds and "fire" it. The spikes' positions could be drawn randomly at runtime, or handpicked in advance. And if you want to use lots of spikes, the Object Pool Pattern would definitely come in handy (you only spawn N objects that you keep reusing afterwards).
If you lack experience in development, the best thing you can do is dive in. Think of a way to implement this, it probably won't be perfect, it might even totally fail, but just code it. Once it's done, try to understand what went wrong, what design flaws you could have avoided right at the beginning, what problems appeared afterwards as a consequence... Even if your code sucks and is not exploitable at all, if you analyze it and understand your mistakes, it won't have been a waste of time.
Also, you definitely have to look into design patterns. Countless people have had exactly the same problems you have/will be facing (not always in the same context), and many great solutions that will definitely come in handy have emerged.