14 Replies
Im trying to do this in c#, but I dont know what the syntax for it is
right now what i got is
Edited
Comments use
//
in c# (though /**/
for multilines). Give a and b type declarations. Make the method return type a bool, as it uses logic operator. The logic operator for and is &&
.
I assume “object” in your example code is a placeholder name. You should make it an actual rectangle class/struct, though I assume that is what you mean’tthanks be to GOD random person, i thought it was returning int, but i didnt read the comments haha
object is for things like player object
in my code
im gonna check collision between two objects for the method im gonna be using
Did you name a class “Object”?
no
Ah okay. Then you’re good
it gives the error
for this
Also, access modifiers cannot be used within methods. Simply do:
int myInt = 0;
Well, you gotta complete the pseudo codethanks be to GOD person
yeah i was guessing that too but i wasnt sure
well thanks be to GOD random person for helping me
i will closethe thread now
No worries. Glad I could help. :)
Also, chances are you don't want to use
Object
but rather a concrete typeI thought thats what objects do?
i mean are
you make objects out of classes using new
Well, yes
You make a class
And you instantiate it
And wherever is supposed to use that instance, uses that class as the type
What you have here is the
System.Object
type, though, which is basically an any
type
Unless... you made your own class that's named Object
, in which case I'd probably reconsider that namei see
thanks be to GOD random person