|
|
#1 |
|
Baseband Member
Join Date: Jan 2010
Location: Canada
Posts: 68
|
I am currently working on creating some old arcade games such as asteroids and tetris that will work and appear in console. I have gotten most of them to work but I do have a question. Is there any way for me to register a score and store it as an executable so that I can re-save over the executable that is there. This may not be possible but any info or code that you could give me would be incredibly helpful. BTW I am trying to do all of my code in C.
__________________
dIxie The hacker mindset doesn't actually see what happens on the other side. |
|
|
|
|
|
#2 |
|
Site Team
Join Date: Jul 2009
Posts: 2,627
|
I'm not sure of how you'd put it in the executable - that'd involve changing the program at the same time that it's running which is a bit awkward at best and plain not allowed on some systems.
Why not just put it in a separate file somewhere like every other game does it? If you don't want people editing the score then you could look into some form of basic encryption... |
|
|
|
|
|
#3 |
|
Site Team
Join Date: Mar 2004
Posts: 6,945
|
no. the exe file running the game will be locked.
also in order to do that you'd need to release the source as a part of the game, in the game, and include a compiler in the game, so that when a high score was registered the source in the game would be altered to include the high score then recompiled to replace the existing .exe, all in all a rather messy approach. you'd also probably find that you couldn't link the compiler without permission from the creators. what you need to use is a text file to store the high scores. this can be read/written/replaced with simple file functions available to C.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian… Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns. "The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries." |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|