Jump to content

  • Log In with Google      Sign In   
  • Create Account

Edvinas Kilbauskas

Member Since 01 Jul 2011
Offline Last Active Apr 10 2016 01:40 AM

#5143378 beginners BreakOut in Unity

Posted by on 30 March 2014 - 10:49 PM

Too bad there's no Unity Web Player for linux. So I can't play :/

#5121944 I want to create a hack and slash game.

Posted by on 07 January 2014 - 11:14 AM

Seriously, these questions are getting pretty annoying.

Use what you are most familiar. It doesn't really matter. As long as you are skilled enough in any of the mentioned tools, use it. There's absolutely no difference what programming language you are going to use. People playing your games won't care how you made them, they only care if it's fun. So less posting stupid questions, and more work. There's a lot of work you have to do. Good luck.

#5121826 Best Laptop for Game Development

Posted by on 06 January 2014 - 11:46 PM

You're probably not going to do games with crysis like graphics, so GPU is not all that important but it should be fairly modern. I would recommend laptop with atleast discrete GPU. But I think for me the first thing to look in laptop is it's screen resolution. Because I have a laptop with 1366x768 screen resolution and it sucks for programming, I can't fit anything on screen. Even if I open my IDE in fullscreen I still need to constantly adjust the side bars or and toolbar's size so I could fit more code on screen. Get a laptop with 1080p screen. It will be bigger, but much better for programming. If you are going to compile big applications/games then get a laptop wtih SSD, because it will reduce compile time.


There are other nuances when choosing a laptop, but that's all time I have for now. Good luck.

#5120472 Performance problems at ~1,000,000 triangles. Am I doing something wrong?

Posted by on 01 January 2014 - 07:24 AM

Or am I doing something wrong?


How are we supposed to know that without seeing your code? Maybe you are calling glDrawElements/glDrawArrays after every triangle, maybe you have old drivers, maybe you are doing many OpenGL state changes. Many things could be wrong, but you are not helping yourself. Show us code, or give us more info.

#5116109 Totally lost trying to render a 2D tile-based map

Posted by on 10 December 2013 - 11:24 PM

I might suggest you creating a struct that represents tile like this:

struct Tile
    int x;
    int y;
    int graphic;

Then you could do something like this:

int w = 100;
int h = 100;

Tile * tiles = new Tile[w*h]; // allocate memory for new array of tiles with size of map

// iterate through tiles
for(int i = 0; i < w*h; i++)
    Tile & tile = tiles[i];

    // here you can do whatever you want with your tile.
    // for example renderTile(tile.graphic, tile.x, tile.y);

There are many ways to implement this. You could also use std::vector instead of array for storing tiles, because it would be much easier to add and remove tiles dinamicaly.

Also you might not want to store tiles position in struct, instead you could use 2d array, like you tried to do before, then it would look something like this:

int w = 100;
int h = 100;

int ** tiles = new int[w][h]; // allocate memory for new array of tile graphics with size of map

// iterate through tiles
for(int y = 0; y < h; y++){
    for(int x = 0; x < w; x++){
        int tileX = x*32;  // 32 would be the space bettwen tiles on x axis
        int tileY = y*32;  // same thing for y axis
        int graphic = tiles[x][y];

        // for example renderTile(graphic, tileX, tileY);
        // do whatever you want with this tile

Also, we would probably want to store not only graphic in our array, but also other data, like if its collidable or not and other stuff. In that case, we would just replace "int ** tileGraphics = new int[w][h];" to "Tile ** tileGraphics = new Tile[w][h];"


As I said, there are many ways you could implement this, it's up to you what suits you best.

#5113738 So, where do I start?

Posted by on 02 December 2013 - 07:20 AM

You know what? Try the game maker. You can get it for free now (it used to cost 50$), it requires little knowledge of programming and it is easy to use. If you are into game design, you should worry less about programming stuff, and more about creating games. Most of people here are programmers first, gamers second, and they care more about programming, than about making a good game. So don't learn C++ and OpenGL just because everyone tells you to. I would say gamemaker would be a perfect choice for you.

#5104055 How can I gain a deeper understanding of C/C++?

Posted by on 24 October 2013 - 04:30 AM

Some of the advices might be true here. But if you really want to understand how programming and computers really work together, you should learn Assembly language, at first you might be scared of it, because a lot people think it's the holy grail of programming languages, and they think that only best of the best can learn it.


While it might have some some truth to it, but even knowing a little bit of Assembly will help you A LOT! I was learning assembly for a month or so (I just really wanted to try it out), and I already understand better how linker works, how everything is compiled, how exactly stack works, where passed arguments go, memory management, and all that stuff. I can even write my own simple x86 kernel!


So if you want to get started, download or buy a book called "Assembly Language Step by Step". It is meant for total newbies who want to learn Assembly as a first language, and he has some good points on why one should learn Assembly as first language, and not Python or Java as other people tell you.

I promise, you will gain a better understanding of programming langues and deep C. 

Afterwards you might even want to disassemble your C code and read it in Assembly to  better understand how things work inside.


Also, I checked out those slides, I saw few parts where it talked about registers, data segment, and other stuff I wouldn't probably have known before reading book on assembly.


So go learn some Assembly and good luck with your learning! smile.png

#5103648 Unmaintainable code

Posted by on 23 October 2013 - 05:08 AM

According to the famous essay "Real Programmers Don't Use Pascal" you could say that whoever wrote this game is "Real Programmer", because:

  • Real Programmers can write five page long DO loops without getting confused.

#5103642 Unmaintainable code

Posted by on 23 October 2013 - 04:59 AM

This is... wow. If that actually compiles without errors, and the resulting binary actually works, then I bow in awe.

Not only it compiles, it is also very successful indie title.

#5102786 Unmaintainable code

Posted by on 20 October 2013 - 02:08 AM



#5089847 How to develop a very basic game? I don't have any programming knowledge...

Posted by on 28 August 2013 - 09:31 AM

How is this brilliant Jimstyle guy getting a negative rep? he's just asking honest questions.

I fixed that ;)

#5075493 Python Pygame Pong

Posted by on 05 July 2013 - 11:07 AM

In the drawGame function, delete the pygame.display.update()

That will fix it for ya.


It was like that because you had 2 pygame.display.update() functions in your "while not gameIsPlaying:" loop. So what happened is you drawn the game, flipped the buffer, then drawn the text and flipped the buffer again, so text and game were drawn at different buffers. So when it updated, it did it really fast, and you saw different buffer every frame, and that caused the flickering.

#5074157 Intro to programming

Posted by on 30 June 2013 - 08:50 AM


. C++ looks easy and understandable to me.




This must be some new definition of easy and understandable I wasn't previously aware of ;)


I remember when I was starting programming, my first language of choice was C++. And I didn't understood why people called it hard either, until I learned python.

#5072723 Help with a 2D Space Shooter!

Posted by on 25 June 2013 - 06:10 AM

You are right, but just change

sf::Vector2f bulletVelocity(mousePos.y - shipPos.y, mousePos.x - shipPos.x);


sf::Vector2f bulletVelocity(mousePos.x - shipPos.x, mousePos.y - shipPos.y);

#5072710 Help with a 2D Space Shooter!

Posted by on 25 June 2013 - 04:25 AM

As I see no one is willing to give you straight forward answer. But I think I can answer to your first question, about angles and shooting.


This is how you do it:

sf::Vector2f mousePos = your mouse position vector;
sf::Vector2f shipPos = you ship position vector;
sf::Vector2f bulletVelocity();
sf::Vector2f bulletPosition();

float shotAngle = atan2(mousePos.y - shipPos.y, mousePos.x - shipPos.x);

bulletVelocity.x = cos(shotAngle);
bulletVelocity.y = sin(shotAngle);

bulletPosition.x += bulletVelocity.x;
bulletPosition.y += bulletVelocity.y;

This should get you started. I can't really tell more, because it would kill all the point of the programming in the first place - which is problem solving.

You should go google some vector math, get comfortable with those before you dig deeper into game programming.