Jump to content

Another quick problem requiring solution


Guest Croccy22

Recommended Posts

Guest Croccy22

This has got to be easy but yet again my brain has turned into mush.

At the moment I am decalring an array at the beggining of my code like this:

int LevelData[64] ={1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,3,};

the problem is later on the game this gets modified. What I need though is when a new game is started, LevelData[] must be refilled with the original data.

How can I do this. I have tried doing like LevelData[64] = {1,2,3,4,} etc but it doesn't work. Does anybody know what I mean??

I know I can fill it number by number but I don't want to do that.

Help????

Matt

Link to comment
Share on other sites

Guest v1nn1e

original[] = working[] ???

This will jus copy the pointer to the memory location of the data. It won't actually make a duplicate of the array. changing original[1] would be the same as changing working[1] because they point to the same thing.

You have to copy each element using a loop to a new array.

This is how it is done in JAVA

Link to comment
Share on other sites

Guest Croccy22

Yeah thanx just figured it out. I have been programming far too long today. Oh well nearly finished public Beta!

And yes I know there is still stuff to do (as you will find out). But tough! :lol:

Just really wanna see if anybody actuallt plays the game before wasting my life coding it!

Matt

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.