Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Tetrix  (Read 5503 times)

0 Members and 1 Guest are viewing this topic.

Andrei15193

  • Guest
Tetrix
« on: July 05, 2012, 09:09:16 am »
Hello,

The title says it all, I'm making a clone game after Tetris using SFML. It isn't something original, or complex. It's more of a learning project for me. Getting familiar with the SFML Framework and Documentation is my primary goal in the programming area at this moment.
For more info check: https://bitbucket.org/Andrei15193/tetrix/wiki/Home.
« Last Edit: July 06, 2012, 04:28:58 pm by Andrei15193 »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Tetris
« Reply #1 on: July 05, 2012, 02:44:38 pm »
Hi

Since there isn't much to comment about yet, I concentrate on the class diagram. The first thing that took my attention are the many uses of inheritance. It is sometimes questionable, why is a figure a special figure builder or why can one adjust the width and height of a square? I don't really see the purpose of GameWindow and its inheritance from sf::Window, are the members really necessary? Also the superclass Object reminds me of Java. I suggest to read about the LSP.

By the way, there are a lot of open source licenses :)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: Tetris
« Reply #2 on: July 05, 2012, 08:46:44 pm »
I just thought I would toss this in that Tetris is a trademark here in the US. You might check the status in your country just to make sure before calling your game Tetris. The thing about using a trademarked name is that the company is bound to go after you for using it otherwise if they ignore it and let you use it then others could claim Tetris is a generic term. Laws on this vary from country to country though.

Other than that I think that a Tetris-clone is a great way to familiarize yourself with SFML.

-Steven




Andrei15193

  • Guest
Re: Tetris
« Reply #3 on: July 06, 2012, 12:42:43 am »
Hello,

Thanks for the link on LSP. About GameWindow specializing sf::Window, yes it is necessary. The UI is in charge only with displaying data and handling system events (clicks, key presses), the actual job is done by a controller (class Game), when a system event occurs the GameWindow sends a message to the controller (via method) or when the Window needs to display data it asks the controller(s) for that data via messages (methods). The only two members that are questionable are the _width and _height members (that may be removed if the following setters are inline functions) since sf::Window has getWidth() and getHeight() methods, however no getters for title and style.

About the special figures, they lack the word "Builder" in their names (as specialized builders is what I had in mind). As for the Square having setters for width/height, I actually wanted to emphasize that the shape height/width setters will be overwritten (however there won't be any setters of that kind since that would be a new shape). However setters and getters for x and y are good, a shape can change it's coordinates, and a getter for type. That about covers it up.

About the name, well I haven't thought about that. Well if I can't use this name I'll dug up something similar :P. Thanks for the tip by the way ;)

And so version 1.1 is born :D, thanks for the input guys!

Andrei15193

  • Guest
Re: Tetris
« Reply #4 on: July 06, 2012, 04:09:52 pm »
Updated link.

Acrobat

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Tetrix
« Reply #5 on: July 06, 2012, 10:08:44 pm »
stop making frameworks, make games

Andrei15193

  • Guest
Re: Tetrix
« Reply #6 on: July 07, 2012, 09:41:37 am »
stop making frameworks, make games
What?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: Tetrix
« Reply #7 on: July 07, 2012, 10:54:10 am »
stop making frameworks, make games
What?

When I can read four forum messages on my smaller notebook screen then some people didn't understand the sense of a forum... ::)

Acrobat your comment wasn't helpfull at all and in some forum might get flaged as spam. Not that your statement is completly wrong, but if you write something like this ellaborate at least. ;)

What he's trying to say is, stop thinking about the design and how you could what and just go ahead implement a game. It refelects one of the two major opinions under developers. Some belief it's better to sit down think intensivly about a design and how one could make it better and others think to just go ahead without much planing so you spend your time actually doing something instead of just thinking.
There's truth in both opinions though and that's where each developer has to make some trade-offs. For once one has to keep in mind that a engine/framework should be created for one specific game and never try to make it as generic as possible. On the other hand you can't just go and start programming blindly if you care a bit about code design and structure, otherwise you'll end up having to rewrite hundred lines of code just to change something very simple.

A good and professional way of development is TDD, Test Driven Development.

When will we get to see some code/demo of Tetrix?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Andrei15193

  • Guest
Re: Tetrix
« Reply #8 on: July 07, 2012, 12:15:18 pm »
Ah, thanks for clearing up eXpl0it3r.

Well, I didn't want to go directly into coding without having a basic plan. About starting apps by blindly coding, I know what you mean. I've learned that making a small review of the problem before starting to solve it makes better for time and efficiency (at least for me).
Thanks for the TDD slides for C++ ;)

Code and demo for Tetrix are coming up soon. More will be added to the class diagram, in respect to the features, when what is already there will be fully implemented and tested. At worse it will be next week.

The only addition to the design will be the Game UI.

Andrei15193

  • Guest
Re: Tetrix
« Reply #9 on: August 02, 2012, 12:36:59 pm »
I know it's a bit later than announced, however I finished an alpha version for the game :) The home page of the projects wiki has been updated, download links are available there for both Windows and Linux/Unix OSs.

The class diagram will be completed and after that the code will be refactorized and a v1.2a release will be made public.

Controls:
Left, right, down arrows to move the current figure, up arrow to rotate the current figure, esc to exit.
The game will also close when the next figure has no room on the top.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: Tetrix
« Reply #10 on: August 02, 2012, 03:57:22 pm »
Just so you know the download links for the Linux version aswell as the Windows version, don't work (one gets a 404 error from ubuntuone).  ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Andrei15193

  • Guest
Re: Tetrix
« Reply #11 on: August 02, 2012, 05:45:58 pm »
That's really odd of UbuntuOne, I tested it with a friend and it works. I added a SkyDrive link, can you try it out and let me know if it works? I tested the SkyDrive link with the same friend it worked for both of us.