|
Основной форум Сюда все проблемы связанные с программированием. |
09.04.2009, 11:33
|
#1
|
AnyKey`щик
Регистрация: 05.04.2009
Сообщений: 4
Написано 2 полезных сообщений (для 18 пользователей)
|
Question from holland :)
Hi guys
I have a question for you, I've been altering the multiline source to make a nice game about hacking, its a sort of a simulator like in the movies where you will have to buy programs, hack in to banks, that kind of thing. I am trying to make a procedure I can just call upon to keep the source code as little as possible, so as you can see procedures gamescreen are questions you can answer, and procedure gamescreen tells what is happening.
Everything seems to be working fine in the emulator, however when I put the compiled java on my Sagem 300c phone after the second question it just shows the storyscreen very shortly and skips trough it right away.
I do not know why that is, I can only guess that it is because the previous click is still in memory?
program HackGame;
uses text;
var option1, option2 : integer;
play, clicked : command;
optie1, optie2, verhaal : string;
key: integer;
schaambef: integer;
procedure question (optie1, optie2: string);
begin
ShowMenu('Select a game', CH_IMPLICIT);
option1 := MenuAppendString(optie1);
option2 := MenuAppendString(optie2);
play := CreateCommand('Play', CM_SCREEN, 1);
AddCommand(play);
repeat Delay(100); until GetClickedCommand = play;
end;
procedure gamescreen (verhaal: string);
begin
showCanvas;
text.init;
text.set_text_par(10, 10, getWidth-10, getHeight-10, 1, 16, 2, 64,verhaal);
setColor(128,255,0);
fillRect(0,0,GetWidth,GetHeight);
setColor(0,128,64);
text.draw_mult_str;
Repaint; Delay(100);
repeat
setColor(128,255,0);
fillRect(0,0,GetWidth,GetHeight);
setColor(0,128,64);
text.draw_mult_str;
Repaint; Delay(100);
key:=KeyToAction(GetKeyPressed);
if key=GA_UP then text.Mode_Up;
if key=GA_DOWN then text.Mode_Down;
if key=GA_LEFT then text.Page_Up;
if key=GA_RIGHT then text.Page_Down;
if key=GA_FIRE then schaambef := 1;
Delay(100); until schaambef = 1;
schaambef := 0;
end;
begin
gamescreen ('blablablablablabla.');
question ('hello there', 'question here');
gamescreen ('another question here');
question ('hello again', 'option two question');
end.
I really need your genius russian coolness here, help a dutch guy out.
|
(Offline)
|
|
09.04.2009, 15:29
|
#2
|
Элита
Регистрация: 14.06.2008
Адрес: Украина, Киев
Сообщений: 2,273
Написано 754 полезных сообщений (для 1,833 пользователей)
|
Ответ: Question from holland :)
I have not understood sense of your message. You use the translator (google)? It works as "broken phone". Try to write in native dutch language, and I will try to translate through google. =)
Последний раз редактировалось Phantom, 09.04.2009 в 15:34.
|
(Offline)
|
|
09.04.2009, 16:54
|
#3
|
Разработчик
Регистрация: 06.04.2008
Сообщений: 541
Написано 196 полезных сообщений (для 637 пользователей)
|
Ответ: Question from holland :)
По поводу Sagem'ов ничем не могу помочь. Хотел только сказать, что переменная schaambef у тебя явно лишняя. Я бы переделал код вот так:
program HackGame;
uses text;
var option1, option2 : integer;
play, clicked : command;
optie1, optie2, verhaal : string;
key: integer;
procedure question (optie1, optie2: string);
begin
ShowMenu('Select a game', CH_IMPLICIT);
option1 := MenuAppendString(optie1);
option2 := MenuAppendString(optie2);
play := CreateCommand('Play', CM_SCREEN, 1);
AddCommand(play);
repeat Delay(100); until GetClickedCommand = play;
end;
procedure gamescreen (verhaal: string);
begin
showCanvas;
text.init;
text.set_text_par(10, 10, getWidth-10, getHeight-10, 1, 16, 2, 64, verhaal);
setColor(128,255,0);
fillRect(0,0,GetWidth,GetHeight);
setColor(0,128,64);
text.draw_mult_str;
Repaint; Delay(100);
while true do begin
setColor(128,255,0);
fillRect(0,0,GetWidth,GetHeight);
setColor(0,128,64);
text.draw_mult_str;
Repaint; Delay(100);
key:=KeyToAction(GetKeyPressed);
if key=GA_UP then text.Mode_Up;
if key=GA_DOWN then text.Mode_Down;
if key=GA_LEFT then text.Page_Up;
if key=GA_RIGHT then text.Page_Down;
if key=GA_FIRE then break;
Delay(100);
end;
end;
begin
gamescreen ('blablablablablabla.');
question ('hello there', 'question here');
gamescreen ('another question here');
question ('hello again', 'option two question');
end.
Надеюсь, я ничего не напутал с синтаксисом, так как давно уже не пользовался Midlet Pascal'ем.
|
(Offline)
|
|
Ваши права в разделе
|
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения
HTML код Выкл.
|
|
|
Часовой пояс GMT +4, время: 20:35.
|