flat assembler
Message board for the users of flat assembler.
Index
> Main > How to make an High Score ? |
Author |
|
baldr 08 Jun 2010, 07:29
vanzan,
Ask player for his/her/its name, associate this name with corresponding entry in high-score table (if it exists). Update when game is over. |
|||
08 Jun 2010, 07:29 |
|
vanzan 08 Jun 2010, 07:46
Ok, but I want to make a simple system like old school game.
Like this: http://pocketnow.com/html/portal/reviews/0000000447/review/highscore.gif I want to set the table to 10 entries. And insert the player's score in the table if it exceeds the minimum. I know how to sort an array of numbers, but I do not know how to associate the nickname of each player to score in the tri ... The 10 channels are set: should I make a second table for correspondence between the nicks and scores? |
|||
08 Jun 2010, 07:46 |
|
baldr 08 Jun 2010, 08:30
vanzan,
There are many ways. You may add another array of pointers to player names where player_name[j] corresponds to high_score[j], or modify high-score table to be composed of struct { int high_score; char *player_name; }. |
|||
08 Jun 2010, 08:30 |
|
edfed 08 Jun 2010, 10:21
IT VS ASCII Arkanoid in DOS 8086
ok, lets say that 8086 is a little obsolete. |
|||
08 Jun 2010, 10:21 |
|
vanzan 08 Jun 2010, 11:25
We aren't allowed of using MACRO (structure, if..end,...) :/
|
|||
08 Jun 2010, 11:25 |
|
baldr 08 Jun 2010, 12:36
vanzan,
Structure is a programming paradigm, you don't have to use language concepts (such as struc-macro) to implement it — especially in assembly language. Can you use symbolic constants (equ)? |
|||
08 Jun 2010, 12:36 |
|
edfed 08 Jun 2010, 14:54
for structures, i use offset table.
Code: item_model: .param1=0 ;offset 0 in item .param2=4 ;offset 4 in item .param3=8 ;offset 8 in item .... item dd 0,1,2 .... mov eax,[item+item_model.param1] ; mov eax,0 mov ebx,[item+item_model.param3] ; mov ebx,2 mov ecx,[item+item_model.param2] ;mov ecx,1 with that, you don't use macros. But... learning assembly Without macros only on emu8086 is like learning C without .h |
|||
08 Jun 2010, 14:54 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.