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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Futochu

Pages: [1]
1
Did not know these existed!  Thanks.

EDIT: Super easy to use to solve this issue.

2
Hey all, I've recently been working on a map generator as an experiment with VertexArrays.  Originally I had been working with sprites, but at higher zoom levels I found that the rendering process was so resource intensive there was no way I could implement anything else.

As a result, I switched to VertexArray drawing which initially seemed to work quite well.  However, if I am to zoom in the rendering seems even slower than before (!?).  Unless I'm doing something wrong, this seems completely counter-intuitive to me.  Could someone point me in the right direction?

The code in question (The RenderArray work is in this branch).

The offending code is probably in Tilemap.cpp

Thanks.

EDIT: This was due to textures being loaded every draw cycle.  Higher zoom = larger images.  Who knew texture loading was so resource hungry?

3
General / Re: Selecting tile with mouse on an isometric map
« on: February 10, 2015, 09:20:00 am »
I was afraid that would be the best answer.  Thanks though

4
General / Selecting tile with mouse on an isometric map
« on: February 10, 2015, 07:14:48 am »
Is there an accepted way of determining the tile your mouse cursor is hovering over in an isometric map with varying heights?  It's trivial to map the position of a mouse cursor to a tile if all heights were zero, but I can't for the life of me figure out how to get a tile that has an unknown height.  This is what my map currently looks like (excuse the placeholder graphics). 

http://i.imgur.com/nOLvK37.png

I've read about things such as image maps to determine relative positions, but does this work when heights can vary by +/- 512?

Thanks.

5
SFML projects / Re: Serpent - A simple snake clone
« on: August 21, 2013, 03:13:47 am »
Make sure you didn't remove any necessary assets!

Alphabetically, your asset folder should look like this:

Apple2.png
eat.wav
loop.wav
MANZANIT.ttf
menuback.jpg
pattern.jpg
snake.png
snakebody.png
snakehead.png

I've found one small issue yet again, the apple can spawn underneath the snake. Apples should only be able to spawn on empty grid cells.

Actually, this is programmed in as an acceptable occurrence due to the additive nature of the gamemap.  It's not a bug, it's a feature!

____________________________________________________________________________

UPDATE:

Serpent v1.0 released I guess.

Now with:

Death sound
Green apples (Ew!)
Red apples don't spawn beneath you (but green ones do.  Suck it, Trebek.)



_________________________________________________________________
NEW UPDATE:

Serpent v1.1 released

Now with:

Score

New executable Serpent v1.0:

New executable Serpent v1.1:

Serpent.exe

New assets:

Green apple (or rotten apple if you wish)

Death chime

Scorefont

Maybe up to date sourcecode:

Link

6
SFML projects / Re: Serpent - A simple snake clone
« on: August 20, 2013, 10:11:35 pm »
Nice another Snake clone! :)

I really like the graphic style, although the snake could need a different tile for its head. :P

The game machanics need a bit more tweaking, because fast movement is currently not possible, e.g. pressing Up and Left very quickly one after the other, will result in the Snake going Up.
I quickly took a peak at the code, but didn't analyze it that much. What I saw is wrong; you should not mix the realtime input class sf::Keyboard and mix it with events. Use on or the other, but not both at the same time for one task. See the official tutorial in how to correctly handle Event inputs, maybe that will already solve the issue, maybe not - we'll see. ;)

Uhm yeah "music"? :P

Anyways good job for your first project! :)

So basically, instead of

case (sf::Event::KeyPressed):
 if(sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
  presskey = 1;
 else if(sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
  presskey = 2;
 else if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
  presskey = 3;
 else if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
  presskey = 4;
 break;

You want

case (sf::Event::KeyPressed):
 if(event.key.code == sf::Keyboard::Up)
  presskey = 1;
 else if(event.key.code == sf::Keyboard::Down)
  presskey = 2;
 else if(event.key.code == sf::Keyboard::Right)
  presskey = 3;
 else if(event.key.code == sf::Keyboard::Left))
  presskey = 4;
 break;

?

Also, what do you mean by "fast movement"?

Anyway, all your critiques have been noted and rectified.

New executable Serpent v0.2:
https://www.dropbox.com/s/va74qwwgluha20w/Serpent.exe

New assets:
https://www.dropbox.com/s/zv6d70r8n4uptod/loop.wav
Replaces old loop.wav

https://www.dropbox.com/s/ym2kn0b0ijnjtb3/snakehead.png
New snake head texture

7
SFML projects / Serpent - A simple snake clone
« on: August 20, 2013, 06:43:33 pm »
SERPENT:

Though it seems I've been beaten to the punch by another snake cloner, here's my rendition of the game.  It's my first real project in C++ coming in with not much more knowhow than TI-BASIC can provide, but I think that it turned out rather well.  I apologise for any code looking unpolished, or any parts of the overall game feeling sloppy. 

Controls are the usual arrow keys, and the enter/return key will help you leave the "menu".

Unlike others, mine barely has any music, just an annoying 8-bit loop of around 6 seconds.

Unlike others, mine does eat fruit.  Apples in fact.

Unlike others, I do not have an "excellent fail screen".

I hope you enjoy it anyway.





Download link:
https://www.dropbox.com/sh/wu8vg4a6dtdk8y0/zj9DafPIdg

Source code:
https://github.com/Futochu/Serpent

Also, please bear with the 33/16 time signature music.  I can't seem to fix the music.

Pages: [1]