Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 27 Jul 2012
Offline Last Active Jul 12 2013 04:49 AM

#5010061 need some pointers :D

Posted by archanian on 12 December 2012 - 09:47 PM

A couple of pointers:

"new" is a keyword and is used for creating an instance of a class. You can't assign something to it.
I believe what you're looking for instead of this:
[source lang="csharp"]new = player();[/source]
is something like this:
[source lang="csharp"]Player somePlayer = new Player();[/source]

Additionallty, make sure you end each line with a semicolon.

This bit:
[source lang="csharp"]if darkknight health = 0;[/source]
needs a couple of adjusments. Firstly, you need to use dot syntax for accessing an object's properties. If health is a property of your darkknight object, you access it via "darkknight.health". Secondly, you need to put the if condition inside brackets. Thirdly, don't put a semicolon at the end (it won't break compilation, but the code block following your "if" will never run). What you want is something like this:
[source lang="csharp"]if (darkknight.health == 0)[/source]

[source lang="csharp"]Vec.destroy kyurem();[/source]
From your description I gather that "destroy" is a method of Vec? In which case you need to call it as a method, with "kyurem" as a parameter like so:
[source lang="csharp"]Vec.destroy(kyurem);[/source]

#5000870 How/Who create the GameObjects?

Posted by archanian on 14 November 2012 - 05:43 AM

Holy jeezus wtf happened in here ...

#5000356 Despondent

Posted by archanian on 12 November 2012 - 04:38 PM

Software development is hard, game development is even harder. There is so much to learn, so much complexity to understand.
This is what makes it so appealing, for me anyway. It is the ultimate challenge. When I get bored with my 9-5 developer job, I go home and build games and it makes me happy - even when I am infinitely frustrated with my lack of skills in this area.
Don't give up, keep grinding away, every failure is a lesson learned, and you're improving your knowledge (even if it doesn't feel like it at the time).
You can do it! I believe in you! :)

#4998729 Is SFML a better choice over SDL?

Posted by archanian on 07 November 2012 - 09:46 PM

I have a practical situation whereby you might choose one over the other, as I have recently switched from SDL to SFML for a game I am building.

The game is a tile-based RTS, and I had developed it to the point where I had a fully functioning scrollable map + minimap + menu system. I started to use per-pixel alpha with some transition tiles that fade through varying degrees of transparency, and hit a brick wall with SDL's performance with this (a well known limitation of the library).

So I decided to give SFML a try, and converted my map engine to use this library ... and as expected the frame rate more than doubled. I'll be using SFML going forward on this project, due to the requirements of my game.

As others have said, it all depends on what you want to do. For complex alpha transparency, SDL is definitely not the way to go at the moment.

#4996416 What Sorts of Algorithms and Data Structures are Useful to Game Programmers?

Posted by archanian on 01 November 2012 - 09:39 PM

Some off the top of my head that I've found useful to learn:

- Stacks & queues
- Linked lists (mostly singly-linked but you may find all the variations useful)
- Trees

- Sorting algorithms of all varieties
- Pathfinding algorithms (A*, Dijkstra's)
- Object pooling

#4995284 Will using LINQ hurt engine performance (C#)?

Posted by archanian on 29 October 2012 - 09:54 PM

I asked myself this very same question not long ago, whilst building a game with SDL.NET in C#. I had a bunch of LINQ expressions (lambda syntax) sprinkled throughout my code for the same reasons you mention - it is very readable and easy to get a grip on what is going on.

It then got to the point where I needed to find places I could speed up a few hot sections of code, and it turned out that by abandoning LINQ in favour of hand-written alternatives I was able to get quite a big performance boost in several places which made a noticeable FPS difference. This was because I was using these LINQ expressions in places that were being called every frame, which is not ideal. If it's something you're only calling every now and then, I guess it's fine. But for code getting hit every frame, you really want things to be as fast as possible, as you'll inevitably rewrite it later to get the best performance possible.