Jump to content


Member Since 19 May 2010
Offline Last Active Jun 20 2016 12:58 AM

Posts I've Made

In Topic: Weapon copyright?

28 January 2016 - 10:07 AM

Ah great to know :) So i just need to figure out now which guns i may or may not beable to use in a game. Trying to search over a list to see if the companies are outdated or not and to see if i can also put some modern guns into my game.


Thank you all who replied to this Topic you helped me alot!

In Topic: Hire a teacher, use tutorials or buy a book?

02 June 2015 - 03:58 AM

I would suggest buy a book. The reason for this is very simple. If you go to school for about 1-2 years you will always have the same content written in a book. The teacher will follow that content even if its out dated. Example: When i was in school learning to design websites. I was told to use <table></table> for structuring things also to always use HTML 4.1 as a DOCTYPE. Later when i got a job ( This was 3 months after) my future boss asked me to deisgn a simple website. I did so with tables of course. He then denied and said we use <div></div> and not tables . Also we are a uptodate Company we use the HTML 5 Doctype.


The conclusion is if you go to a school pay 20'000 USD or whatever your currency is and never move forward from the old state of programing. Then you be left behind which most IT Specialists are scared of. 


Then again if your still young (around 16-18) and can choose a path to go and you wish to program games. Pick IT Specialist. This may sound bad since you mostly wont work with games but mostly make websites or other programs while you work. But this is your learning phase and when you bypassed that phase and still have your mindset on video games. You will do the same as me and learn to program other things in the free time like me :P. Just keep this in mind "If you want something, don't just think about it. Work! Do something! Actions speak louder then Words do!"

In Topic: Trying to add features to this game (HTML5/Javascript)

14 April 2014 - 05:34 AM

If you want to make a bigger level, you could use dynamic arrays.  (It seems that all arrays in JavaScript are dynamic.)  so basically:

var sizeX = 100, sizeY = 100;

var map = new array(sizeX);
for (int i = 0; i < sizeX; i++) {
  map[i] = new array(sizeY);
  for (int j = 0; j < sizeY; j++) {
    map[i][j] = 0;

Would make a map 100x100 in size, and you access the values of the map this way: map[x][y].  All the values are initially set to 0.


Then I would perhaps make an array for the tiles:


var tiles = array();


tiles[0] = (Some reference to the image tile, attributes, etc that you need, 0 being 'nothing', 1 being 'grass', 2 being flowers, etc.)


Point is to make a list so that each value in the map array directly maps to the index of the tile table.  Example: if map[10][10] returns '4', its tile is retrieved using tile[4].


Just to flesh out my immediate idea.


For your movement, you could have a position x, and y for your character.  You also have values for the visible width and height of the visible position of the screen in number of visible tiles, and the top left corner position of this rectangle in the map.



You have a map sized 100x100.  You are positioned at 30x60.  The visible width and height is 21 tiles in each dimension, making you see 10 tiles ahead in every direction, not counting the spot you are on.  This makes all my coordinates inclusive start and end, meaning that a range from 20 to 40 means 21 tiles. (20 = tile 1, 21 = tile 2 ... 39 = tile 20, 40 = tile 21)


You would then start drawing the map at positions x = 30 - 10 = 20, y = 60 - 10 = 50, and end at x = 30 + 10 = 40, y = 60 + 10 = 70, but you need to check the borders so you don't go past the size of the array in either direction in x and y. 


You have to decide on:


1. The character must always be in the centre: this means the border of the map somehow must be allowed to move to the centre.

2. The character is allowed to move around on the map freely without being in the centre, and that moving beyond a certain point bumps the map one or more tiles.  This allows the map border to never be drawn inside the visible area, and the character to move all the way to the edge of the screen, when the character reaches the end of the map.

3. Make enough bushes and mountains to never allow the border of the map to come inside of the screen.


Sorry if I am not clear enough, I just brainstormed a bit here.  Just ask if anything is unclear.  smile.png


Edit: I also think that reading about prototypes in JavaScript will come in handy too.  That will allow you to do some class/object oriented-like kind of things that you can use for the tiles like:

var tile = function()
this.fileName = 0;
this.solid = false;
this.somethingelsethatyouneed = something;

tile[0] = new tile;
tile[0].filename = 'somefile';



I am not sure if this is the best way, but you get the idea.  If you want to see the details how I did something similar, view the source code of:




I even started on a tile editor once that I never finished because I needed to do some major restructuring to make an effective GUI in JS:




(And I really consider myself a n00b...)


Ah Thx for the Replys :) Im very Thankfull for your feedback and im Sorry that i haven't replied back in such a long time. Been to busy with Work and my Personal Life.


Anyways to the code, i been trying out the things you been telling me and it seems to quite frankly work properly. I will continue evolving the game and will contact you if there are other types of questiones i have. 

In Topic: Best way to handle input in SDL?

04 January 2014 - 06:46 PM


I've always used to expose all current user input in a singleton called InputManager, which has it's state updated on every frame. On every frame, i poll SDL input for changes, and update the state of InputManager. Then, all my game objects are able to ask it for the state of keys like this:




Do you guys think this is a good way of handling input? How do you do it in your engines?


Hiya Vinny


My preferd way of handling input would be event driven. I just think its a much better and cleaner way of handling inputs and events all togheter. Then again thats my opinion and maybe someone else has better points on handle keyboard input. 

If you need some examples check http://lazyfoo.net/tutorials/SDL/index.php Lesson 3 for event and Lesson 4 for keyboard handling

In Topic: how to think like a programmer

19 April 2013 - 01:23 AM

I'm going to be making my own game soon without using tutorials and just using what I know. What I'm having trouble coming up with is the logic of the game. Things like upgrading weapons and towers, how to make ai detect when theres something in their way, things like that. Are there any books or tutorials that help with this kind of thinking while making a game?

Hm well there are surely many ways how to plan out a game before starting, but my favorite one is surely the UML. You can use the UML to have a graphical view, of the class and actions in them. Point out of which classes you will need for your game. We use for example the Tower Defence, a  very loved game by many. Now what does a Tower Defence need? We surely need a Tower class since there are towers, surely enemies aka the waves that appear, and maybe a upgrade class for some upgrades the towers need. These are just the logical ones for the game you need, now for the needed ones. You need Initialize that handles all the loading of data, a event which handles all input events, loop which handles all the data updates, render which handles all the rendering of anything that  shows up on the screen and cleanup that simply cleans up any resources loaded. These needed ones, i got from the sdltutorials on how to make a tictactoe, if you wish to check out here you go: http://www.sdltutorials.com/sdl-tutorial-basics . Now next after you got all does things we use a Sequenzdiagramm. In there you will produce a graphical display on how the programm handles, like how does the application start? Which class will come first and so on. These are pretty much roughly said the main ones who are needed to think like a programmer while aiming for a game.


I do hope i could help you with my ideas and wish you a great day


Yours Truly


Your friendly programmer :)