I am more than 2 weeks trying to master unity engine on it´s free license before buying it…but I am a little depressed here because my game is gonne after I have installed itween e uninstalled it …and Now when i try to open my game project with my backuped scripts it just closes it when i try to play the game…2 weeks wasted in trash…And I was almost there Now I want to ask you guys if you know a framework or simply a code ( NOT THE BUGGED TETRIS CLONE PLEASE ) in C sharp and not in java to make cubes in a 2D orthographic camera to keep being spawned and controlled by the user with a decent collision system to make the user takes the same spawned cubes and allocate them on a 10 x 6 matrix? I was trying to use a matrix to do this but that DAM OnTriggerExit for nothing works. I can get the OntriggerEnter or OnTriggerStay, but even using iskinematic + istrigger on the same cubes it seams not to work at all!! I really think unity should have a board game example in 2D to gives an example of how to use the collision system with the same or different blocks ( but not like a tetris because no one wants to be sued here )
Well sorry for the angered post but my 2 weeks of hard working are gonne!
Try creating a new project and copy your old scripts into the new assets folder. Of course, you will have to recreate any scenes and reattach your scripts. Don’t copy the itween stuff if you think that is what caused your problem.
Difficult to read your post there, but unless this game requires physics then for 2d grid-based games or board games you generally want to program the game simulation to just run on a 2d array and forget about the graphics side of things until you’ve got everything working. The graphics simply reflect what is happening inside the 2d array, while all the logic and “collision” is reduced to simple operations on your array.
This is the sort of approach I’d take for any kind of game like chess, tetris clones, a tile-based RPG, etc. That also means that your game graphics are entirely separated from the logic, which will make porting the game or changing the graphics much simpler. Trying to make a board game by attaching scripts to the graphical pieces or a tetris game where the blocks themselves deal with collision and logic is going to complicate things unless there’s a reason (like physics or a non grid-based system) for it.
And yeah, you don’t need to start again. All your source code is still sitting there in plain text files.
Thank you for your replies but in a matter of fact I´ve already created a new project and copied all scripts and then when I try again to run the game PUFF! unity closes from nothing giving me an error( and the scripts have no error because I haven´t done any changes in them, only 2 scripts). I am going to start over again!! With the tetris clone project I saw a manager and a blocks script just like my project. I have been programing games for about 3 to 4 years but I never tried to make a board game ( only action, plataform and space shooter games) And don´t worry because I only put visual stuff after the engine is completed. But I´ve never thought that matrix based board games could be so complicated ( not just the position but the main problem is the collision itself from falling blocks hitting the ones above them) I even tried to make the box collider smaller on the X axis to let them pass throught the side from the others above. A Pathetic way to fix!! T_T
I also can see that most of the support language from the forum is in java and not in C sharp ( and that is sad ) I really like C, I have nothing against JAVA also but native languages for me are the best. well thank you for your replies and if you guys find a frame work or a demo from falling blocks please share with the comunity.
Use whatever language you wish, both javascript (really, unityscript) and c# have the same amount of the support. The new script reference allows you to view examples in JS, C#, and Boo.
As for your crashes on launch, you can always copy your assets one at a time (with Unity running) to determine which one is causing the crash.
It’s not really that complicated; you just check positions in an array instead of using physics. Physics isn’t really appropriate at all for that kind of game.
Unity doesn’t use Java, it uses what they call Javascript but is more accurately called Unityscript, since it’s unique to Unity. It’s exactly as “native” as C# is.
If you don’t have regular backups, you’re basically shooting yourself in the foot. This applies to anything and everything on a computer.
I’m repeating myself, but if your game is just a grid-based falling block puzzler you don’t need collision detection or physics. You know where the blocks are in your 2d array, so you know when to stop them “falling” yourself. Don’t overcomplicate things for yourself, just get the game itself working and you can animate some blocks falling later on to match the state of the game in your 2d array.
And to quote myself:
Start a new project, copy and paste the bits you’ve already programmed or use it as reference to start again.
Thank you for your reply guys!!
I have a Question:
If you have 64 x 64 blocks ( power of 2 ) falling down how would you guys check the collision for example to make 4 blocks together ( 2 blocks below and 2 blocks above those 2) know they are colliding with themselves so you could just destroy them? not a full row but just 4 blocks 2 above 2 from the same tag type?
How do you guys check the collision for a block game like this?
Tell me what´s the best way to declare an array in C sharp here for this example? Like:
public static int[ ][ ] board;
or 2 arrays like this:
public static int[ ] boardWidth;
public static int[ ] boardHeight;