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 - tanmanknex

Pages: [1] 2
1
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: May 18, 2012, 02:43:13 am »
I have great news!!!  I have (finally) gotten around to finalizing version 0.2.0!  There's some really cool features I added and some pretty major changes I've made. 

Changelog:
Added inventory support
Added the "hotbar"
Added two more block types: sand and brick
Added collisions (mostly, still a little buggy)
Added the option to switch between flying and walking
Added gravity and jumping (spacebar)
Many file system cleanups:  Source is in src folder, images are in a resources folder, and the world is in it's own folder.
I also removed all the old files that aren't being used anymore.  The whole folder should now look neater in general.

Controls:
Left click to remove block
Right click to place  selected block
1-9 to change selected block
E to open inventory
E/[esc] to close inventory
[tab] to switch between flying and walking
flying:
  W, A, S, D to move
walking:
  A, D to move
  [space] to jump

Known Bugs:
Sometimes when the player collides while walking/jumping, it freezes the game.
If you start going left first, the world glitches and jumps once.  After that it's fine.
If the world glitches (previous bug) and places you behind a block, the game freezes.  This is also why in this version you cannot place a block within a 64 pixel radius around the player.  I'm going to do something to make it handle it better in a later version.
Sometimes gravity seems immensely strong and pulls the player down instantaneously.

Download Links:
https://legacy.sfmluploads.org/file/136
This contains a codeblocks file that is completely updated, along with all the source and resources.  It also contains an xCode project file, but it hasn't been updated in quite a while, so not all of the necessary files are included and there are some that have been deleted since then.  I'll try to get around to fixing that today, but it might be a little while.

Thanks for following this project!  I'm sorry for taking so long for an update, but it's nearing the end of the school year and I've had AP tests.  Feel free to make any suggestions to me regarding code, features, bugs, or anything else!  If you have any questions, feel free to post them here and I'll do my best to answer them as soon as I can. 
Thanks again,
Tanmanknex

2
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: May 06, 2012, 06:47:52 pm »
@iHope: I hadn't noticed there was a .pkg installer available but I got it now.  Thanks anyway though! 

@everyone else: My next update won't contain collisions.  I tried to get them to work but it didn't work and I didn't have the patience to fix it at the moment so the next update will contain an inventory.  The one after that will have collisions.

3
General / Re: SFML 2.0/Ubuntu 12.04
« on: May 06, 2012, 06:44:12 pm »
It turns out it was an OpenGL problem and installing a new driver fixed it.  I don't know why that didn't cross my mind but I'm glad it crossed yours.  Thank you so much!

4
General / SFML 2.0/Ubuntu 12.04
« on: May 06, 2012, 07:15:44 am »
There is something that went seriously wrong when I upgraded to Ubuntu 12.04.  I had a perfectly working installation before the upgrade, but now whenever I try and run my project, it opens up a random looking window.  In the console log it shows this over and over:
nvfx_screen_get_param: 95 -  Warning: unknown PIPE_CAP [number]
with different numbers in place of [number]. 
What's wrong and how can I fix it?  I haven't been able to find anything on it through my usual sources (google, yahoo, etc.).

5
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: April 29, 2012, 08:30:41 am »
Okay, everyone, here is version 0.1.0!  It is a complete rewrite of the previous version from scratch.  If you have programming experience, any advice on my coding skills would be appreciated!  I have a lot of improvements over the previous version.  Here they are:
-New world  size with random generator
-Correct block placement
-Player arm points at mouse
-Five blocks to place/remove (dirt, grass, stone, cobblestone, and wood)
-Uses wasd keys to move and 12345 to choose block type.
-Uses SFML 2.0

The next version 0.1.1 will have a new collision system, hopefully more accurate than before.  I have some ideas that I think will be really good for it, so hold tight!

Download link:
https://legacy.sfmluploads.org/file/132
((I apologize for any inconvenience, but I cannot upload a mac package until I can figure out how to install sfml 2.0 on my mac.  The source code is included should you wish to compile it yourself.  Once again, I apologize for any inconvenience.))

6
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: April 27, 2012, 12:59:43 am »
Sorry for not having an update on Tuesday, but I was having issues with block placement and removal.  I was having a bit of trouble detecting which chunk you are clicking in, but I worked it out!  I also added a thing where the player's arm points at the mouse.  On top of that, I added some code so that the player changes direction when you push left/right!
Working:
Player movement
Block placement/removal (only dirt currently but that'll be easy to fix)
Player's arm tracking the mouse
Player direction change
Random world generation

Not working:
There is a glitch that sometimes shows up when you start out moving left where the loaded chunks jump to the right.  (Note: For some reason it's only when you start out moving left.  If you can look through my code and find why, it would be much appreciated.  If not, then it might be a while until I have a fix.)
There is a bug that displaces the chunks incorrectly if you push up/down at the start or right when the left of the screen is on a border of a chunk. (Note: This is due to the way I'm saving/loading chunks.  I'll fix it in the next update.)
Collisions (Note: This will be the next update after I release the multiple block/indicator update)

 I can release an update today, or I could wait until I have the multiple blocks and the block indicator working (probably tomorrow or next day).  What do you want me to do?

7
General / Re: Correct way to do player movement
« on: April 23, 2012, 03:29:53 am »
I'm not very experienced, but I think I know what you mean.  Would the sf::Keyboard::isKeyPressed(sf::Keyboard::(key)) work for your purposes?  As you can probably guess, it returns a boolean of whether or not the key is pressed.  Maybe have a couple variables that store the current key and previous key and whether or not they are pressed?  Like I said, I'm pretty new to programming and SFML but hopefully I helped you think of something.

8
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: April 22, 2012, 06:21:53 pm »
Hey everyone, just a quick update of my progress so far. 

Here's what works:
Moving around the world (no player yet)
Loading chunks continuously (pretty much forever in each direction)
Resource Manager

Here's what doesn't work yet:
Player (I just haven't taken the time)
Collisions (no player to collide with yet)
Placing/removing blocks

After I get those last few things, I'll release an update.  You can expect it by or on Tuesday. It'll be version 0.1.0.

9
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: April 20, 2012, 12:08:01 am »
Hey all!  As you may have noticed, I don't have an update out.  This is due to my choice to upgrade to sfml 2.0.  I didn't think it would be too difficult, but it turns out it's more difficult than I thought.  For some reason, I'm having issues with loading textures/images and returning them from functions.  I have a couple questions.
1. Is it possible to draw an image directly to a sprite in sfml 2.0?
2. Is it possible to return a texture/image from a function (I'm thinking resource manager)?  I've tried but it returns a white texture.
3. What would the best way to draw the world to the screen?  I have it divided into three chunks with a texture for each (in my world class).
Any answer would be much appreciated!

10
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: April 18, 2012, 01:53:21 am »
Thanks for reporting the bugs!  I'm completely redoing everything from collisions to world loading, so hopefully those bugs will be gone with the next update.

11
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: April 05, 2012, 06:59:20 pm »
I apologize for not having an update yesterday but I was having issues with the random chunk generator.  That's right, the world is no longer just one file!  I have updated it so that the world moves around the player.  I'm going to be out of state for the next week (Spring Break!) but hopefully I'll have a fully working version 0.0.3 when I come back. 
0.0.3 will have:
-Random chunk generator
-Moving world
-Ability to load world from files
-Much larger walkable distance and higher ceiling for the level
-Possibly a surprise ;)
Thanks for your interest in my continuation of this project, it's why I'm still working on it!

12
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: April 02, 2012, 10:06:33 pm »
Okay, so for the new version (probably to be released tomorrow or wednesday), I will have completely rewritten the game.  It will be version 0.0.2a and will have the following changes:
The player no longer moves around the level; the level moves around the player.
Better memory usage.
New chunk generator.
Thanks again to eXpl0it3r for the suggestions!

13
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: March 31, 2012, 04:36:51 pm »
@eXpl0it3r:
Thanks for the binary and screenshot!!!  As for the code base, thanks for these suggestions!  I haven't been programming very long and I only started this project like four days ago, so the feedback on how to code is helpful. 
Clean up meaning what exactly?
How would you suggest I get rid of the global variables?  I was thinking maybe to have a global function that returns an image? 
I'll look into a resource manager a little bit in the future.
How would I use std::vector instead of an array?  Do you mean for the map layout and stuff?
What did I hard code besides using numbers for materials?
I'm going to fix the separate inputs sometime soon, that's just how it worked out because I had the world working then added entities.
Why is the mouse stuff faulty?  What happens?  I haven't noticed any problems except on my old junky computer which can barely handle a text editor and/or a compiler.
Thanks, I will!

14
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: March 31, 2012, 12:28:16 am »
One more thing, I tried to link the libraries statically using what aBallofWin posted, but it says that it couldn't be found.  Any suggestions?  If not, then I suppose I can just compile a version for sfml 2.0 as well, though that'd just be one more thing to do for each post.

15
SFML projects / Re: 2dCraft (Minecraft 2d port)
« on: March 31, 2012, 12:25:27 am »
So here is version 0.0.2:
OS X:
https://legacy.sfmluploads.org/file/119
Linux:
https://legacy.sfmluploads.org/file/121
Windows:
https://legacy.sfmluploads.org/file/123
Source:
https://legacy.sfmluploads.org/file/120

Changelog:
New:
To move, you now use A and D for left and right and [space] to jump like you do with the original Minecraft
You can choose which type of block to place by pushing [1-5] on your keyboard.

Fixes:
You can left click to remove a block and right click to place.  You can no longer place a block over another block.
Collisions work much better, though still aren't perfect.

If anyone would like to compile this for windows and upload it I wouldn't have any problems with that.  Any tips on how to do things better would be much appreciated!!!

Edit: There is a problem with the linux version and the source code where when the space bar is pressed it closes.  It is fixed in the OS X version and will soon be fixed in the others.  Sorry for any inconvenience!
Edit 2: Fixed in all three files!
Edit 3: Added windows binary thanks to eXpl0it3r!

Pages: [1] 2