My little Tick Tack Toe game...

Pages: 12
Hello,

I have a little Tick Tack Toe game that i'd like to show everybody.

Use Up-Down-Left-Right keys to move the map.

Though it's not completed, it's playable. Please let me know your suggestions and your comments. I'd be very very appreciated!!!

Tick Tack Toe link :
http://www.mediafire.com/download/x37u5nerjsh878o/Tick_Tack_Toe.zip

Screenshot :
http://www.mediafire.com/download/85kb7rjfjjt8d2t/XO_Screenshot.zip
Last edited on
Any suggestions?
Most people are not going to download a zip from an unknown person. Put the source code up somewhere, like GitHub with instructions on how to build and I'm sure people will give you suggestions then.
Thanks for replying, ResidentBiscuit.

Then, how about 7z, rar, then? Is zip file nowadays totally not safe?

It's okay if you guys want me to make my code public. But I need some encouragement. It is just a game with pure purpose and you can use online virus scanner or such all you want. Just one or two comments about my game is okay and I really want to know if you guys like it. And...

Would you guys be so nice to trust an unknown person like me and test it and give me some (brief) comments about my game? I really, really appreciate it from the bottom of my heart!

Looking forward to your comments and suggestions and answers.
Then, how about 7z, rar, then? Is zip file nowadays totally not safe?


Most people won't trust those formats either, it doesn't really have anything to do with the safety of zip files more so that we have no idea what is inside of those zip files. More then likely it is just your game you want to us to critique, but it could also very likely be a virus or keylogger, or any number of things.

It is not so much that we don't trust you since you seem like a nice person, it is just we don't trust the internet. The best way to keep your system secure is to distrust and be skeptical of everything on the internet, so hopefully you don't take it personally.

But as ResidentBiscuit said your best way to get people to look at your game would be to upload the source code to a service like GitHub. We can then build the game from source which we know to be what it says it is, and we can also give you more meaningful feedback because we have the source code available.

Also you can use one of the many picture hosting services to host your screenshots also instead of using a zip file.

Anyways if you do upload it to GitHub I would be glad to check it out and give some comments on it.
Last edited on
@Z e r e o

Thanks for giving me such a very helpful and admirable advice.
I think you are a very wonderful person.

I am still new to GitHub, so not sure whether or not it is acceptable. So I'd like to hear some of your comments out in order to hopefully improve my experience. Also, I'd like to hear some of your comments on my game too!

This is my GitHub for my Tick Tack Toe game :
https://github.com/aquavillan/tick-tack-toe-123
Any comments on the game?
I google searched Haaf's Game Engine and clicked on the first link. My browser turned red and warned of malicious files ahead. That does not inspire confidence that your game is safe.
int strlenA(char *str) // There might be some mistake that the built-in function strlen() is not loading. Define another one instead

... are you kidding me?
@cire

I wish you didn't look at it. Of course this is false and it is just a funny comment after all :)

Did you download my working project and did it compile properly? If you have trouble with HGE libraries, you can google "HGE forum" (it is a safe website) and download the lastest version available (on Github), which are (personally) hosted by the member 'kvakvs'.

@mgoetschius
What website did you click on? HGE homepage? HGE forum? Could you please tell the specific?

You can easily access HGE homepage by googling "hge relishgames"

http://hge.relishgames.com
Last edited on
aquavillan wrote:
http://hge.relishgames.com


Google chrome warns me just like mgoetschius.

The site ahead contains harmful programs

Attackers on hge.relishgames.com might attempt to trick you into installing programs that harm your browsing experience (for example, by changing your homepage or showing extra ads on sites you visit).

Google Safe Browsing recently found harmful programs on hge.relishgames.com.

If you understand the risks to your security, you may visit this site before the harmful programs have been removed.
I think it is due to that the HGE homepage has not been probably maintained recently. I just browsed this website last week using Firefox 29.0, and I didn't see a warning like that. However its forum is still active and is safe, I even gave you the details and you should really check it out first. You can still access the HGE homepage via Google cache and I think there are still HGE links available to download.

HGE actually has a pretty long history, its homepage had always been active from 2003 to 2008 until its latest version 1.81 was released. So far there hasn't been any new version since then and it has been (more than) 7 years since its latest release. Well, something bad must have happened to it recently, because it has stayed inactive for so long without regular maintainance.

But I still have to say that it is a pretty good DirectX 2D c++ game engine. A typical example for this case is game "Hammerfight". There are a number of places to download HGE (even on Github). Websites are just the places to host HGE, one of them may get broken or blighted they have nothing to do with the contents inside HGE package no matter what the reason it can possibly be.

You can visit this (it also contains some intels about the trouble hosting HGE website)
http://relishgames.com/forum/index.php%3Fp%3D/discussion/6235/hge1.81-all-ides-directx-8-directx-9-shaders-httpkvakvs.github.iohge
Last edited on
Sorry for double post. My old cell phone couldn't handle a large amount of data. I couldn't reedit my post.

You can visit this website (which contains some intels about the trouble hosting the HGE homepage website)
http://relishgames.com/forum/index.php?p=/discussion/6235/hge1.81-all-ides-directx-8-directx-9-shaders-httpkvakvs.github.iohge

Edit : If my project compiles please let me know a few of your comments on my game soon. In fact, you can even comment without having to recompile my game and just some comments on the results are more than enough so that I can keep going. Seeming that there are quite a number of people who don't know about HGE so if you can't comment on my code abilities, could you please comment like a gamer? Have you looked my code on Github properly again and again for what that is called "malicious code" and did you find it? Have you downloaded my working project to see what my project is like? Have you scanned my files and did it detect a threat? And is there anything else that you are still afraid of?

How is the graphics? Sound? Gameplay? Is there a game bug or something? Is there any feature missing, incomplete or needs to be added?...
Last edited on
Concerns:
It's one big file.
Lots of globals.
Including C header files.
Use of macros.
Why recreate strlen?
Why even use C strings?
Why recreate strcmp?
getShortFileNameA returns bool? Doesn't make much sense.
Weird naming conventions.
Returning ints as status codes.
Inconsistent return types on functions.
GetSelectedBox returns bool?
"// To do : Add your own code here"? Is this code all copied from somewhere?
HTEXTURE. Gross.
Magic numbers. Magic numbers everywhere.
Indentation is bad in places.
"// Not yet used, but it will be very useful in the future". Don't have pointless code.
"struct boxEffectStruct" Make that a class.
CleanUp is empty? Sounds suspicious.


That was from a 3 minute skimming. This code looks to be almost 100% C. Are you wanting to write C++ or C? It also looks like most of, if not all of, this code was copied from somewhere, judging by the comments I see.
@ResidentBiscuit

I know C++...

That is just how an incomplete project is. I am a self study programmer, but I tend to comment like how typical professional programmers explain things and stuff (TODO part etc). It may pretty looks like a sample or something, but there are also 'TODO' comments in places that is not general. It is based on HGE tutorial 3,
I will finish off everything once I feel like can continue. Before that I think it is good to take a break and test my project's potentials by posting my project on forum.

There is some reason why I am afraid of using functions like strlen and strcmp. Performance reason. Also with implementations available, I should be able to see code in my very big project (not this one) while debugging. If I copied the code from somewhere, then it wouldn't have such problems. The code probably would even look more perfect than ever if I did that. I think this is pretty odd comming from me but if you guys tell me that this is really a bad style, then I will fix that habit right away.

To be continued...
Last edited on
Well, I know C++. Is it that we use modern things and stuff like cin, cout, string, vector etc? If you tell me that my code almost looks 100% C, it seems like I still have a lot more to learn after all...

I know this is a big file, but I will eventually divide it into some files when my project grows to the point that I need to.

HTEXTURE is one of HGE basic data types. Another example is HMUSIC, etc

I have to check is the cursor is inside a certain box. Returns true if found plus the position of the box selected (X, Y), and false otherwise.

I initially want to clean up what I have used when exiting (HGE objects etc) But I think even without cleaning it does not produce fatal errors so I think I don't need to.

Also, there might be concepts that I don't really understand.

1. What are magic numbers?

2. What are weird naming conventions?

3. What are inconsistent return types of functions?

Your corrections are very helpful. But there are also things I don't really catch on. Please don't go so hard on a novice like me...

Thanks. And I'd be glad to hear some comments and feedback on the game results soon.
Last edited on
most of those things residentbiscuit said are bad style, so I would probably fix them.
Magic numbers are numbers that are used in code where if someone had no prior experience to the code it would appear as if you are doing random operations to your variables. Take a look at the following code:
1
2
3
if(x > 10 && x < 20 && y > 15 && y < 30) {
//Do stuff
}

It is fairly obvious that you are determining if a point is in a box, but what is the box? It is questions like this that rise when you use random numbers. Obviously it gets a lot worse and you start doing physics calculations replacing values you know with numeric literals.
To correct the above code, one could write:
1
2
3
if(x > OKButton.left && x < OKButton.right && y > OKButton.bottom && y < OKButton.top) {
//Do stuff
}

This way the code is not ambiguous to whoever is reading it.

Weird naming conventions are similar. They are basically where you name objects in a way that is either not consistent, or is hard to read. There are several standard conventions in terms of case( camelCase, PascalCase, using_underscores, m_MemberVariable etc ) and lots of people will have naming rules where they might for example say all variables are camelCase and all functions are PascalCase. But it also means that any names you give should be clear, unambiguous and short (< 30 chars if possible).

Inconsistent return types literally means that you have several functions which do a similar job and hence should probably return the same thing, but they return different things for no apparent reason. For example:
1
2
3
4
5
6
7
8
9
10
11
 bool operationA ( unsigned& out )
{
//Stuff
out = result;
return did_it_fail;
} 
unsigned operationB()
{
//Stuff
return result;
}

Both of these are valid. The first usually used where an operation may fail and hence the result is given in an out parameter and the second is usually used where an operation is guaranteed to succeed (or relies on exceptions instead). Problems arise when you mix the two for no good reason because it means you have to go back to the declaration of each function to be sure what it returns, rather than it being obvious.
Last edited on
There is some reason why I am afraid of using functions like strlen and strcmp. Performance reason.
These are both O(n) operations whose implementation is fairly simple, and which I am fairly confident your standard library implements better. Your strcmp is actually slower than what I'd expect a sane implementation of strcmp to be, since you iterate over your strings twice (strlen). Anything you may have read about bad strlen performance was likely because of excessively calling it when it would have been better to store the length of the string somewhere.

Is it that we use modern things and stuff like cin, cout, string, vector etc?
Yes. C++ is not merely an extension from C. It has its own methodologies, and those classes simplify a plethora of common operations.

-Albatross
Last edited on
Thanks for all your responses. I've fixed those that must be done.

I've also come to understand (theorically) what magic numbers, weird naming conventions and inconsistent return types are. However, it's still difficult for me to figure out which lines in my code that use magic numbers, or inconsistent return types (I still haven't had a clear image of them yet). So it's better that I demand one example for each case.

Well, here's how I understand the thing which is called "weird naming conventions" (if they get approved, I will use them to continue to fix my code) :

For example, I need to use a lot of globals. People who are famililar with HGE might catch on this pretty easily, but those who are not will be very confused and will have a hard time going back to declarations again and again to be sure what those variables are for. But by adding suffix (g_) for example, a programmer can better summarize the code even through it's the first time he/she has seen it. Especially, when they use (::) to find a function or a variable.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
HGE *hge = 0; // It is obvious, so don't add a prefix

HEFFECT g_mMusic = 0; // Music data type
HEFFECT g_mWinning = 0;
HEFFECT g_mClick = 0;

uint32_t g_ScreenWidth = 800;
uint32_t g_ScreenHeight = 600;

uint32_t g_Border_Thickness = 20;

RECT g_BorderArea = RECT(0, 0, 0, 0); // Area that contains the border

// etc


When adding members, add a suffix (m_) before their names (Unless they are totally obvious). Members that are marked "private" can have different suffix so that to help programmers search for public-type members much easier.

1
2
3
4
5
6
7
8
9
10
11
12
class A
{
    std::string m_name;
    std::string m_full_name;
    std::string m_occupation;

    uint32_t m_salary;

    private : 
    std::string p_email;
    std::string p_telephone;
};


Last edited on
Pages: 12