Making a Bejeweled Blitz clone [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
so I've got to make a Bejeweled Blitz clone for my Programming I. class in C#, but I'm a bit stuck on it, because it's a little above my current knowledge, so I would like to some help from you guys.
The task is as follows:
Make a Bejeweled Blitz clone. In this game, the field is 79*24 maximum,
and there are balls scattered on the field with different colors. The
object of the game, is to erase as many balls as possible by switching
two adjacent balls, so that there will be two or more balls of the
same color next to each other. These balls are erased from the game,
and the balls above them take their respective place and the emptiness
on the top of the field will be filled with new balls with random
colors. Erased balls are worth point depending on the number of erased
balls. So 2 erased balls are worth 2 point up to 5 points. At the
beginning of the game the player states their name and for how long
they want to play in minutes. At the end of the game the player's
name, the duration of the game and the score goes into the
leaderboards, which is arranged in duration then score. The
leaderboards are stored in a txt file.
So this would be the program I have to write in C#. I'm not really sure as to how to do this, so I would really appreciate some help. Thanks in advance!

I understand your problem, because when I was in school I had same problem with my game development project. My Answer is going to be a starting point, so it may qualify for some hater from you.
First you need to be clear on
Entity object of your game. For example how a GEM will be stored in memory, or behave like on mouse over etc. You need to write them down and define various classes based on them. [pseudo classes only]
Then you need to search a Game Engine if you want, I would rather go with default WPF or Windows Form for fact they were in my skill set when I start learning C# at my time [Oh I built a Chess Game].
Learn how you handle mouse click on GRID of Screen that is not consist of Button or Textfield, but a Picture box probably. and with mouse position you find the underlying gem etc.
Then attach them :).
Yes it is simplest and yet the toughest start. But all will be clear if you get #1 done. I put my chess game source at http://vschessmania.codeplex.com/ It use above start only, different game, but has all what you need to built with a Game Engine.

Related

Is there a way to get the number of buttons a joystick has?

Introduction
I am making a game in Unity that was designed for the player to use all the letters on the keyboard. The game shows a battle between two fighters, prompts a key, and the player must mash that key for his character to push the other.
The fun part is that, eventually, the key to be pressed will change to another randomly.
This game is about learning the keyboard for those who haven't learned it, or haven't got used to their flashing new keyboard just yet.
I want the game itself to be playable in more ways, and I made a port to Android that works by touching the sides of the screen, there are flashing button panels that change as the keys would.
Issue
Now, the game has reached more that I want the game to be playable with controllers/gamepads/joysticks, but I'm afraid about two issues.
First and foremost: How can I tell the number of button inputs a controller has? I don't want my game to ask the player to press "JoystickButton19" when in their physical controller there are only 12 or so buttons.
I would add to the question "how do I know the actual name of the button itself?". In an example, how to know if the controller is a JoyCon. I noticed that in Fire Pro Wrestling World on Steam, the game recognizes the "SL" and "SR" buttons, so they got JoyCon specific layout there. If this question has to be answered in a new topic, I will make that.
This is my first question. Thanks in advance!

How to draw on a 3D game object in Unity [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a 3D cube (game object with material) in my Unity 3D application (C# scripts). If the user clicks the cube, I want a small red circle drawn on the cube at the exact mouse position where the user clicked. The cube's position may change as it can move around the board, but the circle should stay on the cube, at the proper position, like a sticker placed on it. Another way to think of it, pretend it's a character and they just got shot. The bullet hole follows that character as they move around.
What is the best way to achieve this in Unity? Ideally, once drawn, I wouldn't have to continue to recalculate the circles position as the cube moved around (as I imagine that will prove difficult over time). I just want it stuck to the cube, again like a sticker.
Note: At any given moment, there would only be 20 or so of these circles, so performance isn't a huge concern.
As mentioned in the comments above, using the transform parent handled this perfectly, in only one line of code:
sphere.transform.parent = cube.transform;

Accessing the 3d model using c# script in Unity3d [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I am developing a software using c# (monodevelop) and unity3d. I am importing a 3d model as collada dae file. Scripts that I wrote must take into account geometry objects in dae file. I am writing some codes but I am new at coding stuff and I can not figure out how I can access geometric objects in dae file using c#. Any help would be very helpful
Since you said you are new with coding, I will start from the very Unity basics.
When you drag and drop your dae file from the project tab into the scene, you will have a GameObject inside the Hierarchy with the same name of dae file. That GameObject can be expanded like Windows Explorer with your all inner objects (they are all GameObjects as well).
To access any unique GameObject of your Hierarchy from C#, you do this: GameObject.Find("desired-gameobject-name");
You can also specify the path of your GameObject if its name is not unique:
GameObject.Find("GameObject1/GameObject2/Etc");
Most part of time when you want to do anything with a GameObject, you need to deal with Components. It's a very simple Unity concept. GameObject may have Components associated with them. The inspector tab shows all Components used by the selected GameObject.
Let's say you want to make a door invisible from your house dae model. You can use something like this:
GameObject.Find("HouseModel/Door").GetComponent<Renderer>().enabled = false;
Now, if you want something more hardcore like getting vertices data, use the MeshFilter component:
Vector3[] vertices = GameObject.Find("HouseModel/Door").GetComponent<MeshFilter>().mesh.vertices;
It will return an array of all vertices from this door.
I hope it gives you some direction.

Kinect Face Tracking Gestures [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I working on Kinect Face Tracking
I want to implement facial expressions. Currently I have:
AU1 – Jaw Lowerer from AUs
AU2 – Lip Stretcher from Aus
I want to implement other gestures like:
Right eye blink
Left eye blink
Both eye blink
And other gestures described here:
https://www.youtube.com/watch?v=6NFsea7CoxQ
http://futuretechblog.com/?p=71
I have a face model points:
But what is the best way to do this?
Now my one idea is to calculate distance between specyfic points. For example:
var distance = Math.Sqrt(Math.Pow(facePoints[10].X - facePoints[35].X, 2) + Math.Pow(facePoints[10].Y - facePoints[35].Y, 2));
Grab statistic of gestures to Exel graph and do like this:
if(disnace<calculatedValue)
My Questions are:
My idea is correct? Can I do this with my idea?
Do you know any dll do detcet face gestures for Kinect C# SDK.?
Do you have any samples of detect gestures?
Do you have any other ideas how to detect gestures?
Thanks! :)
Your idea is rather correct. I have developed some gestures myself for a couple applications, like an eat gesture, call gesture, swipe gesture etc.
You need to do a lot more than just checking distance. You need to check the distance relative with time as well, together with some kind of error margin.
If you would like to bind actions to blinking then you can't just execute the action the moment your distance < calculatedValue, because people blink a lot. You will need to make some kind of gesture finder that keeps track of the current distance for X-amount of seconds and is only triggered if the distance < calculatedValue for X-amount of seconds with an error margin of 90% for example.
You can do this with your idea but don't expect it to work 100% of the time. The distance between your eyes and eyebrows are different for every person. So you will either have to 'initialize' a normal posture for every new user or try to get an average distance in normal resting mode and work with the differences if he blinks.
I have had some experience messing around with such things before. Mostly in OpenCV, but the ideas are still the same. Your approach is essentially correct, but I found that adding two things to the detection algorithm improved it many fold.
Firstly, add an element of time into the detection criteria. How long triggers should detect a gesture before the gesture event fires is very important to the user experience. I would suggest that you have a running average of the gesture detection's local results (say over x many frames), along with a running average for each gesture event being fired. Think of it like stochastic prediction models. (it's not, but I like to think of user experience issues in that light. I find it speeds up how many prototypes I have to build to get it feeling right.)
Whenever I need to come up with ideas for solving issues in this ilk, I always turn to Technical Analysis websites. These are smart people who spend all day trying to visualize trends in nosy data. Might be of some help for you.
Secondly, you will need to have some sort of noise filter. I always start with http://en.wikipedia.org/wiki/Kalman_filter
Good luck!

How to detect if any video is being played now? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
How to detect if any video is being played now using autohotkey, autoit, vbscript, c#, or c?
Video could be being played/streamed in any local player, web based player, or html5 player. We do not know the name of player also player may not be in the full screen.
PS. Detecting CPU load may not give the correct result always, so it is not acceptable.
I've done a small bit of work on this back in the day. There is a WIN32API (old school) that gets/sets whether or not to disable the screensaver (in user32.dll, GetScreenSaverActive(), SetScreenSaverActive - see: http://www.codeproject.com/Articles/17067/Controlling-The-Screen-Saver-With-C). This is the most likely flag to be set when a video is playing but it not 100% reliable as not every player will implement it. It WILL work for most browser videos, whether played through plugin, natively, or via DirectX. This also works for most (all?) external players such as vlc, windvd, etc.
But.
There is no sure-fire, 100% way of determining a video playing. You cannot;
1. Check for sound playing as the user may be using iTunes and not all videos have sound
2. Check for full screen (usually the better option) as the video may be playing in a browser
3. Check cpu/gpu load as it's not reliable and you have no other way to determine
4. Be absolutely sure that the player hasn't cleared/reset the win32 flag when minimized
Another option would be to try and collate a list of possile executable names for all known players (doable but time consuming to find data, espesially on older versions), and check to see if they're running. This isn't 100% reliable either as a plugin by be preloaded but a browser but not actually playing a video at that moment in time.
In short, there's no 100% way that I know of but several ways that'll get you 90-95% there. That is the purpose of knowing if there's a video playing? Perhaps there's an easier way to find what you're looking for...

Categories

Resources