Search found 175 matches

by Clodi
April 18th, 2015, 12:29 pm
Forum: Everything
Topic: how to OOP-code bullets? [SOLVED]
Replies: 19
Views: 6603

Re: how to OOP-code bullets? [SOLVED]

@Chexxor
@albinopapa

Thank you so much for your comments. VERY helpful. I understand most of it. I am going to re-read this stuff tonight and however many times it takes to understand it fully.
by Clodi
April 8th, 2015, 6:45 pm
Forum: Everything
Topic: how to OOP-code bullets? [SOLVED]
Replies: 19
Views: 6603

Re: how to code bullets?

Yes, :D ahah that was actually meant to be proper code. I was translating into C++ but obviously it is not completely correct. Well, I will experiment for a bit and let you know :) thanks a lot for the help. No I am confident that I will be able to make some nice collision functions with my classes....
by Clodi
April 8th, 2015, 12:25 pm
Forum: Everything
Topic: how to OOP-code bullets? [SOLVED]
Replies: 19
Views: 6603

Re: how to code bullets?

Neat thing about javascript is it passes by reference for large data types by default
you mean:

Code: Select all

class Cat() { var x = 0; }
void Cat::do() { x++; }
Then you can also go:

Code: Select all

void Cat::collide( Cat ) { //collide; }
? :D
by Clodi
April 8th, 2015, 11:39 am
Forum: Everything
Topic: how to OOP-code bullets? [SOLVED]
Replies: 19
Views: 6603

Re: how to code bullets?

OK, thanks a lot :) so.. pointers and references are fine.. I wonder if I'll be able to implement this in Javascript. There must be a way.
by Clodi
April 6th, 2015, 3:49 pm
Forum: Everything
Topic: how to OOP-code bullets? [SOLVED]
Replies: 19
Views: 6603

Re: how to code bullets?

Thank you so much guys. :) I have always been thinking: "you can't have a a function in Entity that somehow has something to do with another Entity otherwise the compiler would try to understand what Entity is, it would go through all of Entity's functions and realise that there is a reference to a ...
by Clodi
April 5th, 2015, 9:10 am
Forum: Everything
Topic: how to OOP-code bullets? [SOLVED]
Replies: 19
Views: 6603

Re: how to code bullets?

Because the alternative would be to have a function in GAME called "collision( Entity, Entity )" which is trivial, messy and I have already implemented..

..or even "collision()" with no parameters whatsoever would work since the GAME knows about all its objects within it.
by Clodi
April 5th, 2015, 9:08 am
Forum: Everything
Topic: how to OOP-code bullets? [SOLVED]
Replies: 19
Views: 6603

Re: how to code bullets?

OK, my question is:

Imagine this set-up:

ENTITY <--- PLAYER <--- PLAYER1

ENTITY <--- ITEM

Can you have a thing such as "Item.collide( player1 )" ? or "Entity.collide( Entity )" ?
by Clodi
April 4th, 2015, 11:46 pm
Forum: Everything
Topic: how to OOP-code bullets? [SOLVED]
Replies: 19
Views: 6603

Re: how to code bullets?

Nice one, thanks a lot mate. I was wondering about the "collision" function as well actually.. Would a Game class handling the collisions between objects be better? something like "bool collision( obj1, obj2 );" ? or should subclasses themselves have collision-handling functions such as "entity.coll...
by Clodi
April 4th, 2015, 11:35 pm
Forum: Everything
Topic: how to OOP-code bullets? [SOLVED]
Replies: 19
Views: 6603

how to OOP-code bullets? [SOLVED]

Hello guys, Happy Easter everyone! Has anybody got a fair amount of experience in making video games with bullets in them? I have two characters. One arena and the only way to victory is to shoot the opponent. what is (in your opinion) the most natural / safe / less-painful OOP way of coding bullets...
by Clodi
February 7th, 2015, 3:23 am
Forum: Everything
Topic: 3D engine, issues with RASTERTEK.COM tutorials
Replies: 11
Views: 4981

Re: 3D engine, issues with RASTERTEK.COM tutorials

Thanks a lot AlbinoPapa and Luis!
I'll try that ASAP and let you know.
Thanks a lot for the massive amount of help I always get here. :)

Code: Select all

Clodi