Forum Thread
  Posts  
[Unity3d] I need help on how to program (Forums : Coding & Scripting : [Unity3d] I need help on how to program) Locked
Thread Options
Oct 19 2018 Anchor

Hello, reader!
I'm new here and a student who's currently working on a 2D game for Android in Unity and I need help on the programming aspect of my game.

Below is my old prototype for the game which is made in Photoshop (Everything visually is subject to change but the core gameplay stays)

via Gfycat

I'm having a hard time working on this since I just know the basics of programming. Basically, I just want to know how to make my game spawn arrows into a pattern, and how I could match my button inputs according to what the pattern is formed. (I wish my explanation is understandable.. I hope the visuals helps)
I haven't started on scripting yet so I'm still at 0% progress when it comes to my core gameplay.
Tips and ideas on how I could make this work will be highly appreciated!!
Links to pages or videos that could teach me how is really appreciated also!!

Thank you for reading!

Nightshade
Nightshade Senior Technical Artist
Oct 21 2018 Anchor

I'm not a game programmer (but a TA) so there are probably better ways of doing this but I would start out by splitting functionality into various so-called "managers" - objects that are responsible for a very specific, tiny, part of the game. Keep your main game scene clean of ALL game objects. This because it's much smarter to spawn the GO's with code since polluting the main scene with content is going to force you into one big fat refactor session in the future (no fun) - so avoid it! Generate as much things as possible in a dynamic way. That is my first advice.

My second advice is:
You need to break down a large problem like this into smaller problems (that's what programming is all about). You could break this problem down into the following problems and areas:

  • A manager that deals with drawing any kind of GUI elements. In the beginning you just hardcode everything in it just for testing purposes. After all, you want to display stuff on the screen - that is sub-problem number one. Once that is working you want to remove the hardcoded stuff and make the manager take dynamic data.
  • Moves randomization (make an array that has X amount of random numbers between 0-3 where each number represents one of four directions). When the combo has been generated, the data should be passed on to the GUI manager. Keep this manager small as you probably want to have some kind of enemy manager that talks with the moves randomizer.
  • Player input manager (store in another array) - a manager that keeps track of all input.
  • A comparison function that checks that the player input array matches the combo array. Depending on how large your game is you either want this in the main game loop or as a part of a combat manager. Think of Final Fantasy or Pokemon for instance: Combat is a big part of those games but there are also a lot of other things in the game, like the inventory, the map, et cetera.
  • If the game is gonna be turn-based then you also need a manager that keeps tracks of the turns, who's turn it is (you or the enemy) and a clock if the turns are not infinitely long.

I hope this helps.

Edited by: Nightshade

--

Senior Technical Artist @ Massive - a Ubisoft studio
Portfolio | LinkedIn

Oct 22 2018 Anchor

I suggest you first to follow one o more tutorial made by unity team, will help a alot to undertand the basic of the engine Unity3d.com

iqew
iqew VFX Artist
Nov 15 2018 Anchor

Sent you a pm.

--

Need some polishing for your game with beautiful VFX? Check out my website: Game-vfx.com

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.