Jump to content

  • Log In with Google      Sign In   
  • Create Account

Khatharr

Member Since 24 Apr 2010
Offline Last Active Private

Posts I've Made

In Topic: Why C# all of a sudden?

22 September 2016 - 11:02 PM

- Popularity of unity.
- Tool development at gamedev companies (these are mostly win + c#


Those were the two factors that eventually motivated me to pick up C#. Especially the latter one, since WinAPI is a magnificent pain in the ass and VS has a forms editor built in to it for C#.


In Topic: Inserting element into vector during iteration causes crash

21 September 2016 - 12:57 PM

If we know more about the requirements of the real case then we can provide more specific advice.


In Topic: Need help with Game Maker

20 September 2016 - 06:25 PM

Well, you could use the free version, or you can...

 

http://www.yoyogames.com/get

 

f384008ea9.png

 

I believe that they prefer each user to have an account, so honestly I'd just go with the free version unless you really need to publish to alternate platforms or something.


In Topic: Why C# all of a sudden?

20 September 2016 - 06:19 PM

C# applications will even outperform C++ aplications 90% of time

 

xftyHLD.gif


In Topic: Two classes relying on each other

20 September 2016 - 06:15 PM

I need the address of the owner so that the owner can delete the bullet from memory - unless there's some other way I could do it?

 
The shooter does not need to own the bullets once they're fired. You can have an external container that holds bullets and deals with their logic independently.

class ScaryMonster {
public:

private:
  void immaShootDisFoo(SimpleScene& myParentScene) {
    myParentScene.spawnBullet(allKindsOfArgs);
  }

};

class SimpleScene {
public:
  void spawnBullet(location, direction, speed, etc) {
    bullets.emplace_back(bullet constructor arguments);
  }

  void updateBullets() {
    for(auto& bullet : bullets) { bullet.update(); }
    bullets.erase(std::remove_if(bullet.begin(), bullet.end(), [](Bullet& b) { return b.isDead; }) bullet.end());
  }

  //...

private:
  ScaryMonster blerg;
  std::vector<Bullet> bullets;
  ShinyHero derp;

};

PARTNERS