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

Pages: [1] 2 3 4
1
General discussions / Re: What is wrong with my tutorials?
« on: July 11, 2014, 12:20:25 pm »
@CodingMadeEasy

Man, i watched a lot of your videos and they were really helpful. I didn't really notice any problems.

:D

2
SFML projects / Re: My very first 2 things in SFML
« on: June 24, 2014, 11:34:06 am »
Thats how you learn :)))) just strive to write better code

3
SFML projects / Re: My first game...Failure.
« on: June 21, 2014, 09:57:07 pm »
Well yea sure man, i would recommend reading some smaller tutorials on the internet. There are like sfml pong game, etc.. Or ultimately the sfml game development book, its really good.

goodluck();

4
SFML projects / Re: My first game...Failure.
« on: June 21, 2014, 09:52:27 am »
Hey, nice game :) Im fairly new to c++ too, but i think i can point some stuff out.

Firstly i think sf::Sleep is the wrong way to go, though you have wrote some interesting code lol.

Use sf::Time and sf::Clock.

sf::Time passed_time // outside loop
passed_time += clock.restart(); // inside loop

if(passed_time >= sf::seconds(1.f / 2.f))
   //do something


Also i think 'break' statement goes inside the {}.

Passing my reference seems more logical for me, unless you want to take ownership with pointers or something.

and by reference it is: void introduction(sf::RenderWindow& main);
and introduction(window);

What is also important that you should not load the font anew every time.
You load "arial.ttf" twice, thats a waste :)
Loading resources is usually slow, so better do it outside loop, and pass it in.

It may seem "unclean" because of the number of things you have to pass in, but its okay.
To solve this, you should learn object oriented c++ (classes, inheretence..), it really isnt hard.

With function you could try to sort out things a bit better. Like:

// function definitions

int main()
{
     // declare variables
     // initialize variables (load resources)

   
    // create game loop
   // get input - function
   // update logic - function
  // render - function
}


And you maybe want to add this: sf::Window::setKeyRepeatEnabled(bool).
If you set it to false, you want receive multiple events for one e.g. key press.


I am not sure where the problem exactly is, but i think you should rewrite every thing.   
BEST ADVICE: i really really recommend that you take some c++ book and read about classes, inheretence, polymorphism, abstraction, encapsulation, understand those terms and try to apply them. With them you will be able to create more complicated games EASY.

5
SFML projects / Re: Anyone want to build a 2D game with me?
« on: June 21, 2014, 12:10:57 am »
AndreeU17: are you still looking for someone ? Im working on a 2D rpg game, zelda like.
Got some basic things already done. My c++ is decent, trying out opengl a bit.

6
SFML projects / Re: [Beginner] 2d Tile Map Editor + source
« on: December 30, 2013, 07:19:29 pm »
Hi, thanks for the feedback, i will check those links now :)

What could i use instead of those .rar archives ?

Thanks.

7
SFML projects / Re: Zombination - 2D survival zombie shooter
« on: December 30, 2013, 03:47:50 pm »
game looks awesome, those lighting/lights are really cool, im just starting so i dont know how to do it, i just add tiles, thats all. anyways, good job :D any time releasing soon ?

8
SFML projects / [Beginner] 2d Tile Map Editor + source
« on: December 30, 2013, 03:31:00 pm »
Hello, i made a simple map editor that i wanted to share. Im a beginner in c++, and programming in general, so thats why i wanted a opinion on this code i wrote.

I attached a rar so u can download the program. And i attached another one with the code.

If you want to the code, you are free to use it as you wish.

I had to upload the rar with exe on other site since its too big for attachment.
http://speedy.sh/GkzyH/map-editor.rar

--------------- GENERAL: HOW TO USE ----------------------

FEATURES:

Keybinds:

R - Create Layer
T - Delete layer
Q - Previous Layer
E - Next Layer

C - Set Tile Collision
X - Hide Tile Collision Indicators

G - Hide Tile (Set visibility)
H - Hide Layer (Set layer visibility)

L - Save Map

W A S D - move through palette
UP DOWN LEFT RIGHT - navigate through map

Map Editor

Good practices, avoiding bugs or unexpected behavior:

- Map size (x and y) should be dividable with the tile size.
- Saving often is advisible, and it only takes a fraction of a second.
- Found a bug ? Write/Report it immediatly.


Notes:

- You can create unlimited number of tiles.
- All tiles in a newly created layer will be transparent but VISIBLE. (Transparent tile from tileset)
- You can only delete the last layer unlike creating, and the active layer has to be that one also.
- Hidden layer, hidden transparent tile might at first look can seem like something is bugged, but likely is not.
- Its save to close anyway once you save the map.


Known bugs:
- None found.


To-Do (top->down priority):

- Fix new bugs if found.
- Make it more exepction-safe. (e.g. typing the map name with space inbetween will not crash the editor
- New brushes for faster editing. (Rectangle 2x2 and bigger sizes)
 

Pls try to explain the mistakes i made, tell me if i made some grave mistakes that i should fix.

im also having trouble finding the right coding style (cant decide if i should put an underscore in parameters and similar)

code can crash if u do something you re not supposed, or type random stuff in console when asked something else.

THX

9
Graphics / Re: Best way to draw projectiles ?
« on: October 20, 2012, 12:49:28 pm »
FIXED.

10
Graphics / Re: Best way to draw projectiles ?
« on: October 20, 2012, 10:44:15 am »
I want to shoot with my ship.
They are not displaying, and i dont know if this is a efficient method to make new projectiles.

11
Graphics / Best way to draw projectiles ? [SOLVED]
« on: October 19, 2012, 10:43:17 pm »
Im making a game like space invaders, you fly a spaceship and destroy enemies. I got the player spaceship loading and displaying and moving. Now i want to make projectiles, but i cant get it to work, how should i do it ?
projectiles from your spaceship obviously.

I tried something but kinda failed:

Inside of a class:

static sf::Texture _projectileTexture;
static sf::Sprite _projectileSprite[30];

inside of a .cpp

_projectileTexture.loadFromFile("projectile1.png");
for(int n = 0; n < 30; n++)
      _projectileSprite[n].setTexture(_projectileTexture);

for(int n = 0; n < curProjectile;  n++)
       gameWindow.draw(_projectileSprite[n]);

how i try to make new projectiles:

if(inProjectile == true)
{
        curProjectile ++;
        pProjectile[curProjectile];
        _projectileSprite[curProjectile].setPosition(pProjectile[curProjectile].posX, pProjectile[curProjectile].posY);
        return;
}

General declarations:

int curProjectile = -1;

struct Projectile
{
        float posX;
        float posY;
        bool alive;
};
Projectile *pProjectile = new Projectile[30];

running in main so i can initialize

for(int n(0); n < 30; n++)
{
        pProjectile[n].posX = 20;
        pProjectile[n].posY = 20;
}
 

suggestions please :D


Let me explain here what i did:

1. Load the projectile .png into a texture.
2. Load the texture into 30 sprite projectiles. (hoping that it will be enough)
3. Create with the Struct 30 projectiles.
4. Create/Set position of each one as they get shot.

12
SFML projects / Re: 'Tiled' Tile-map Loader
« on: October 03, 2012, 12:33:06 am »
Im not sure that myself, but i know you can add object property in tiled e.g. "collision" and set it true for certain tiles which you can identify within the script later on. If someone could show us, would be nice :D

13
SFML projects / Re: 'Tiled' Tile-map Loader
« on: September 27, 2012, 10:51:00 pm »
When you save a map with tiled its location of the tileset picture in the map is "../blabbal/mypicture"

so you have to open the map with notepad(text editor) and remove "../" and it will load corrently then, and when editing it back to edit the map with tiled

check paths if they are correct

14
SFML projects / Re: SFGE - Simple & Fast Game Engine
« on: September 22, 2012, 02:21:49 pm »
You still updating this or ?

15
System / Re: Input/output with files help
« on: September 18, 2012, 06:39:12 pm »
I need someone to make me or tell me how to write to specif line.
Hm now that you say i doesnt really have anything with sfml, asides that im using sfml to make a game.


Please help.

Pages: [1] 2 3 4
anything