Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 June, 2013, 14:12:54 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 2 3 [4] 5 6 ... 10   Go Down
  Print  
Author Topic: General Ndless Questions and Support -  (Read 10397 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Levak
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 10:33:21
Date Registered: 04 April, 2010, 23:42:49
Location: France
Posts: 858


Total Post Ratings: +150

View Profile WWW
« Reply #45 on: 22 April, 2012, 00:24:07 »
0

Also, is there a way to save high scores?

Writting in a file ?


1
2
3
4
5
6
7
FILE * f = fopen("/documents/mygame_highscore.tns", "w+");
char buf[integerSize(highscore) + 2];
sprintf(buf, "%d", highscore);
fputs(buf, f);
fclose(f);
refresh_osscr(); // refresh OS screen so that we can see the created file when we exit the program


1
2
3
4
5
6
int integerSize(int n) {
  int i;
  for(i = 0; n > 0; n/= 10, i++);
  return n
}
« Last Edit: 22 April, 2012, 00:28:37 by Levak » Logged

Human always wants to survive and that's why he will fall one day.
My website - TI-Planet - iNspired-Lua
Pages: 1 2 3 [4] 5 6 ... 10   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.184 seconds with 32 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.