SFML community forums

General => SFML projects => Topic started by: csiz on February 17, 2009, 09:44:16 pm

Title: My Snake
Post by: csiz on February 17, 2009, 09:44:16 pm
Uhuuu finally I finished it. My first game in c++ (I almost gave it up when I found sfml). Not very complicated but it works.

Link (http://www.sfml-dev.org/wiki/en/projects/snake) to the wiki.

And feedback is welcomed.

When the snake gets out of the ground (worm tunnels) it is confused. I first wanted to rotate the entire scene but I didn't find rotate in views so it was a little more complicated and I just made the view shake.
Title: My Snake
Post by: pierreyoda on February 18, 2009, 09:51:14 am
Please use a .zip/.rar compressed file, it's better.  :)
.EXE files are dangerous without that. Thanks.
I tested your game : it's impressive. This games without cases, it's not habitually! And graphics are beautiful, and I'm not talking about the snake's rotation (are collisions possibles with them?). I loved the moving screen, like an explosion :P
But they are bad point:
- Under Vista, the main "menu" flashes : is it normal?
- The cursor mouse is ugly : delete and replace it by a pointer or something like that
- It' a bit... chaotic.  :x And difficult for me...
- Where are the sources :?:

EDIT: excuse-me, I haven't seen it was a compressed file  :oops: .
Title: My Snake
Post by: Core Xii on February 18, 2009, 01:17:45 pm
Quote from: "pierreyoda"
Please use a .zip/.rar compressed file, it's better.  :)
.EXE files are dangerous without that. Thanks.


What? There's nothing dangerous about uncompressed executables.
Title: My Snake
Post by: csiz on February 18, 2009, 01:37:27 pm
Quote from: "pierreyoda"

(are collisions possibles with them?)
But they are bad point:
- Under Vista, the main "menu" flashes : is it normal?
- The cursor mouse is ugly : delete and replace it by a pointer or something like that
- It' a bit... chaotic.  :x And difficult for me...
- Where are the sources :?:

What collisions? The snake goes out of the scene but it will eventually return as the mouse pointer doesen't. It stops sending any more events whe it goes out or something like that.

I don't use vista, I tested it at school and it worked well though, except at the end it says "error pure virtual call"

I didn't thought about the mouse but I'll leave it as it is...

Thats how I wanted it to be :D

And I'll make the sources available if you can tell me how can I get a copyright on them (Like Laurent has in the SFML).
Title: My Snake
Post by: pierreyoda on February 18, 2009, 02:32:07 pm
I think you can publish under GPL 3 with a copyright. I see lots of files with :
Code: [Select]
/*
Copyright 2007-2008 - YOUR NAME

This file is part of xxx (Your Project)

xxx software is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

xxx software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
**/


And for the mouse, it was just a suggestion. Like others. The game is quite impressive like that. Is it your first project under SFML?
Title: My Snake
Post by: pierreyoda on February 18, 2009, 02:38:23 pm
Quote from: "pierreyoda"
I think you can publish under GPL 3 with a copyright. I see lots of files with :
Code: [Select]
/*
Copyright 2007-2008 - YOUR NAME

This file is part of xxx (Your Project)

xxx software is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

xxx software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
**/


And for the mouse, it was just a suggestion. Like others. The game is quite impressive like that. Is it your first project under SFML?


PS: And they aren't collisions with worms, spiders... ?
PS: I just see that it's not the screen who moves but sprites... I love  :) .
Title: My Snake
Post by: csiz on February 18, 2009, 03:14:49 pm
I put the source and the copyright with that in. click link again

My second game in total, I made the other one with flash. Oh and c++ is the only language I know (sort of know). So yes this is my first with sfml.

I also made a kind of simulation with it. There are a lot of particles at the beginning and they attract each other (gravity)  and collide. It should simulate the forming of a solar system from a mass of gas to a star and some planets. the graphics are black circles  :lol:
Title: My Snake
Post by: Nexus on February 18, 2009, 03:52:50 pm
Nice, very special controls. ;)
The spider is a good idea, but sometimes (combined with the steering, the worm heaps and the webs) it is hard to evade it. Possibly you could make it slower, or not killing the snake all at once.

But I also got the "flash" problem in main menu (Windows Vista).

Quote from: "pierreyoda"
- Where are the sources :?:
Why is every SFML user expected to publish the source code? At least I could comprehend one not wanting to reveal all his work. Especially if he delivers the application for different plattforms.
Title: My Snake
Post by: Tank on February 18, 2009, 05:08:01 pm
Nice game, but there're several errors in your source.
Besides that, neat graphics! I like the smooth movements and rotations. =)
Title: My Snake
Post by: pierreyoda on February 18, 2009, 05:36:15 pm
Quote from: "Nexus"
Nice, very special controls. ;)
Quote from: "pierreyoda"
- Where are the sources :?:
Why is every SFML user expected to publish the source code? At least I could comprehend one not wanting to reveal all his work. Especially if he delivers the application for different plattforms.

It was just a question. It's question of mentality.

PS: Sorry for multi-posts, EDIT fonction "crashed"...  :oops:  :shock:
Title: My Snake
Post by: csiz on February 18, 2009, 08:45:40 pm
I wanted it to make open source for the beginning so it didn't upset me :wink:

I modified SFML and made that public, the compiler is normal.

What do I use at LoadFromFile("...") exactly? / or \ ( "\\" )
I tried both and they worked on my pc but only one worked at my friends pc (both windows)
Title: My Snake
Post by: dabo on February 18, 2009, 09:28:12 pm
Quote from: "pierreyoda"
- Under Vista, the main "menu" flashes : is it normal?
Happens to me too using XP Pro

Btw, nice game.
Title: My Snake
Post by: Nexus on February 18, 2009, 10:15:02 pm
Quote from: "pierreyoda"
It was just a question. It's question of mentality.
Mine was just a question, too. ;)
I have just noticed that often, the source code of a developped game is requested.

Quote from: "csiz"
What do I use at LoadFromFile("...") exactly? / or \ ( "\\" )
I tried both and they worked on my pc but only one worked at my friends pc (both windows)
Generally, you should better use the slash / instead of backslash \ (raw \\). The advantage of slash is plattform independence.
Title: My Snake
Post by: csiz on April 17, 2009, 11:31:59 pm
compiled it for linux too, you can find it on the wiki