• entries
686
1952
• views
387956

# Blocky Man is using Game Genie!

150 views

So, obviously not what I intended:

Yeah, those spikes were supposed to kill him. I've been working on special tiles that do different things throughout the game(spikes, water, ladders, etc.). Obviously, I still have a lot of work to do.

Now I'm going to ask a programming question that might help me out. I'm not going to use the actual code, because that would just make it more complicated than it has to be. Basically, I have something like this:

struct A{    int *pA;    int *pB;    int *pC;};class B{private:    int numA;    int numB;    int numC;public:    A stuff;    B()    {       numA = 1;       numB = 2;       numC = 3;       stuff.pA = &numA;       stuff.pB = &numB;       stuff.pC = &numC;    }};void DoSomething(A *stuff){    *stuff->pA = 0;    *stuff->pB = 0;    *stuff->pC = 0;}int main(){    B something;    DoSomething(&something.stuff);    return 0;}

After something.stuff is passed to DoSomething(), the values of B.numA, B.numB, and B.numC are not changed to 0. Why?

You forgot to pass the pointer to something.stuff. Should be &something.stuff. That should have given a compile error, or was that a typo? I see you fixed it, my bad.

I ran the example on my end and it did exactly what you were expecting, it set something.numA,etc... all to 0.

It works for me as well.

Yeah, I just fixed it. It was caused by something else entirely, and I was just looking in the wrong place.

Nice gfx style, but is that done on purpous ??

What? Him in the spikes without dying? No that's a bug, but it's fixed now.

I think he means the ghetto art :D

Oh, than no.

But I do think it's pretty funny[lol]

Quote:
 Original post by MarijnStevens Nice gfx style, but is that done on purpous ??

Stompy is famous (or infamous?) for his programmer art. [grin]

Edit: WTF? This post shouldn't be where it is, considering it was posted after the posts which succeed it...

Quote:
 Original post by MarijnStevens Nice gfx style, but is that done on purpous ??

Stompy is famous (or infamous?) for his programmer art. [grin]

I think we will go with infamous.

Look, I might end up getting a pixel artist for my games(to make them look 16-Bit). Or I might get my brother, who is an excellent artist, to hand draw the graphics.

Either way, hopefully I won't be drawing them for long[lol]

## Create an account

Register a new account