Jump to content

  • Log In with Google      Sign In   
  • Create Account

irbaboon

Member Since 07 Oct 2011
Offline Last Active Yesterday, 01:11 PM

Posts I've Made

In Topic: Multiple bullets?

17 April 2016 - 11:09 AM

 

Anyway, look into "std::vector".


Yes, you would be correct if the OP was using C++. But the tags on his topic states “Java,” so he should use java.util.ArrayList instead.

 

Oh my, I didn't catch that.


In Topic: Multiple bullets?

16 April 2016 - 10:09 AM

then it becomes null

 

heh.

 

Anyway, look into "std::vector".

 

 

You could just make a variable like this:

std::vector<Bullet> myBullets;

then use it like this:

myBullets.push_back(Bullet(x, y)); // or however your constructor goes, if any. You can probably do myBullets.push_back({ x, y }); as well

If you have update and draw functions in your bullet class, then you can do this to call those:

for (auto& i : myBullets) { // Loop through all the elements in "myBullet" and let "i" be a reference to the current element. 
    i.update();  // or i.draw();
}

Hope that helps in any way.


In Topic: C++ Passing an unknown class as an argument to a function

26 October 2015 - 05:45 AM

Lets say i want a function to take a class as a parameter but i do not know the class in advance or i want it to be able to take different classes, how can i do it?

Class object;
AnotherClass antherObject;


function(Class &object)
{
   //DO STUFF
};

How can i make "function" take "AnotherClass" as a parameter as well? Overloading is a solution but i would still have to copy the code again. Is there another way?

 

The question is kind of vague to get a good answer.

Sure, you can use templates or polymorphism - but is that really what you need?

 

If you have a specific scenario in mind, I'd advise you to post that and see what response you get then.

Sometimes you might only need to pass a few common variables instead of the class itself.

 

Edit:

Oops, I realised now that Lactose wrote the same thing :)


In Topic: Off shore Development- What to get once the job is done

25 October 2015 - 10:54 AM

Hi Lactose,

Please clarify the following

 

(1) Will he be able to make any changes to the app which is UP and running on the market place without logging into my developer account? I don't think so, but want to reconfirm.

 

(2) It looks like it is better to have the source code in case if i want to make any changes in the future. In this case, what kind of format i can ask him to send me the source code?

 

(3) I am not a programmer and don't know ABCD of game programming. So even if sends some thing, i cant really make sure that this the source code for this program. What are my options in this case except trusting him thinking that he is sending the right code?

 

Thanks

 

1. No

 

2. There is not really a format. As long as you get the code, you should be fine. If he has some fancy project setup, then it would be great if he sent you those or told you how it was set up.

 

3. I doubt someone would do that. Especially if you have made a game with him. Anyway, I would open the source files and see if you can find things you recognise.

For example, see if you find the code for the player or the code for the main menu or enemies. Just read the code a bit like English, and you should figure out what it does.

If you have no idea after that, you should perhaps either trust someone else to look over it, or learn to build the project yourself given you have the project files.

 

Edit:

Got ninja'd. Lactose probably has a better answer than mine though.


In Topic: Programming a simply 2D game

21 October 2015 - 12:40 AM

I think GameMaker is your best option. You barely need to know how to code.

http://www.yoyogames.com/studio


PARTNERS