Извините, ничего не найдено.

Не расстраивайся! Лучше выпей чайку!
Регистрация
Справка
Календарь

Вернуться   forum.boolean.name > Программирование игр для мобильных телефонов > MidletPascal

Ответ
 
Опции темы
Старый 24.11.2010, 21:20   #1
NastyKhan
Оператор ЭВМ
 
Регистрация: 26.09.2010
Сообщений: 29
Написано 0 полезных сообщений
(для 0 пользователей)
keys/game library

Hi,

I'm using "keys" lib. As far as i know, it is the same as 'game' lib, or at least very similar. Now i have a fallowing problem: some old commands like repaint; or GetKeyClicked; doesn't work any longer.

How to fix that?

And what exactly does [lib].init and [lib].show commands?

Thanks.
(Offline)
 
Ответить с цитированием
Старый 24.11.2010, 21:59   #2
ViNT
Модератор
 
Регистрация: 03.04.2007
Сообщений: 2,252
Написано 597 полезных сообщений
(для 817 пользователей)
Ответ: keys/game library

Use Lib_keys, which is placed here
http://forum.boolean.name/showpost.p...93&postcount=2
It use standard MP canvas, so standard graphic functions must work.
Note that this library work only in MIDP 2.0 FullScreen mode.
(Offline)
 
Ответить с цитированием
Старый 24.11.2010, 22:41   #3
NastyKhan
Оператор ЭВМ
 
Регистрация: 26.09.2010
Сообщений: 29
Написано 0 полезных сообщений
(для 0 пользователей)
Ответ: keys/game library

Didn't work.

Using this lib, the game don't even run.
(Offline)
 
Ответить с цитированием
Старый 24.11.2010, 22:57   #4
ViNT
Модератор
 
Регистрация: 03.04.2007
Сообщений: 2,252
Написано 597 полезных сообщений
(для 817 пользователей)
Ответ: keys/game library

Set MIDlet type: MIDP2.0 Fullscreen to fix this problem.
(Offline)
 
Ответить с цитированием
Старый 25.11.2010, 00:19   #5
NastyKhan
Оператор ЭВМ
 
Регистрация: 26.09.2010
Сообщений: 29
Написано 0 полезных сообщений
(для 0 пользователей)
Ответ: keys/game library

Already got it :/ Nothing. Should I add lib_keys.java file to project resources as well?

What about that "GetKeyClicked" things? Any idea how to fix that?
(Offline)
 
Ответить с цитированием
Старый 25.11.2010, 00:45   #6
ViNT
Модератор
 
Регистрация: 03.04.2007
Сообщений: 2,252
Написано 597 полезных сообщений
(для 817 пользователей)
Ответ: keys/game library

Adding lib_keys.java to project is not necessary, this is just library source file.
Possible, there is another errors in your code, because this library work (I successfully built and run simple test project using this library).
(Offline)
 
Ответить с цитированием
Старый 25.11.2010, 01:13   #7
NastyKhan
Оператор ЭВМ
 
Регистрация: 26.09.2010
Сообщений: 29
Написано 0 полезных сообщений
(для 0 пользователей)
Ответ: keys/game library

I don't know. What version of MIDletPascal you use? I'm working with 3.1.

I'll try to be more precise:

When using "my" lib_keys (1,91KB ) - game complies, and run. Some commands like GetKeyKlicked or Repaint does nothing however. In some cases they can be replaced. For example, Repaint can be easily replaced with keys.refresh, but the original function just do nothing.

When using "your" lib_keys (310B )- game complies, and run. However i have blank white screen only.
(Offline)
 
Ответить с цитированием
Старый 25.11.2010, 01:34   #8
ViNT
Модератор
 
Регистрация: 03.04.2007
Сообщений: 2,252
Написано 597 полезных сообщений
(для 817 пользователей)
Ответ: keys/game library

MP 3.1 is very unstable yet, so that use MP 2.0.2 version.

Please attach your lib_keys.class file.
(Offline)
 
Ответить с цитированием
Старый 25.11.2010, 01:47   #9
NastyKhan
Оператор ЭВМ
 
Регистрация: 26.09.2010
Сообщений: 29
Написано 0 полезных сообщений
(для 0 пользователей)
Ответ: keys/game library

Here you go:
http://www.sendspace.com/file/k7ihyn

As i said before. All i need is to make those "standard" commands like GetKeyClicked; or Repaint; working. On all other sides, the lib works fine.
(Offline)
 
Ответить с цитированием
Старый 25.11.2010, 12:26   #10
ViNT
Модератор
 
Регистрация: 03.04.2007
Сообщений: 2,252
Написано 597 полезных сообщений
(для 817 пользователей)
Ответ: keys/game library

This version uses its own canvas, so standard canvas functions are not available. You should use Lib_keys.refresh() method to update display buffer instead of standard repaint function. Functions GetKeyClicked and GetKeyPressed are not available for the same reason. But standard drawing functions (i.e. DrawText) must work.
(Offline)
 
Ответить с цитированием
Старый 25.11.2010, 17:53   #11
NastyKhan
Оператор ЭВМ
 
Регистрация: 26.09.2010
Сообщений: 29
Написано 0 полезных сообщений
(для 0 пользователей)
Ответ: keys/game library

I understand. What are you proposing me to do then? I can switch lib for that 310B instead of my 1,91KB, but as i said - i have blank screen then, for unknown reason. It looks like once executed the program freeze when reaching keys.init; keys.show; lines. Are instructions before that lines works fine.
(Offline)
 
Ответить с цитированием
Старый 25.11.2010, 19:50   #12
ViNT
Модератор
 
Регистрация: 03.04.2007
Сообщений: 2,252
Написано 597 полезных сообщений
(для 817 пользователей)
Ответ: keys/game library

Use 1,91KB version, replacing Repaint by refresh.
(Offline)
 
Ответить с цитированием
Старый 25.11.2010, 20:38   #13
NastyKhan
Оператор ЭВМ
 
Регистрация: 26.09.2010
Сообщений: 29
Написано 0 полезных сообщений
(для 0 пользователей)
Ответ: keys/game library

What about GetKeyClicked? I critically need it.

lib_keys allow me only to do this:

key:integer;

if (keys.get_bit(key, FIRE_PRESSED) <> 0) then pause;


but that function is checking if the button is PRESSED, not CLICKED. For example: I set the game to "pause" by clicking FIRE, and when paused - second click to "unpause". The effect is, that when i press FIRE (for 0.5s) the game begin to RAPIDLY pause,unpause,pause,unpause :/

Other example: I made a slide-show intro, when slides are changed by clicking fire (1 click - 1 slide). But when i press it just for a half of second, i rapidly skip all of them.

One more thing:
As far as I know (might me wrong however) lib_keys doesn't support softkeys, and 1,3,7,9 corner keys.

And:
I cannot make any 'press any key' event, cause lib seems to support only one button per function.

Because of that i just.. NEED something that would check 'clicking' instead of 'being pressed', as well as detecting ALL buttons. GetKeyClicked is good, but it doesn't work.. Help me fix that and i will die happy.
(Offline)
 
Ответить с цитированием
Старый 26.11.2010, 08:12   #14
ViNT
Модератор
 
Регистрация: 03.04.2007
Сообщений: 2,252
Написано 597 полезных сообщений
(для 817 пользователей)
Ответ: keys/game library

Сообщение от NastyKhan Посмотреть сообщение
What about GetKeyClicked? I critically need it.
Then you should use another version (310KB). Possible, this error have another source, not this library. You should check your code completely, because this library doesn't give blank screen itself (how I speaking earlier, simple key reading work fine).

P.S. Note, that MP is very limited language, so that some algorithms can not be implemented (i.e. using GetKeyClicked/GetKeyPressed functions on external canvas) without writing special libraries, or can't be implemented anyway.
(Offline)
 
Ответить с цитированием
Старый 27.11.2010, 12:01   #15
cherepets
Бывалый
 
Регистрация: 18.08.2009
Сообщений: 745
Написано 146 полезных сообщений
(для 215 пользователей)
Ответ: keys/game library

Try this version of lib_keys.
If has 2 functions:
get_key_states and get_bit.
Also it doesn't block repaint and getkeypressed or getkeyclicked
Вложения
Тип файла: zip Lib_keys.zip (452 байт, 421 просмотров)
(Offline)
 
Ответить с цитированием
Ответ


Опции темы

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


Часовой пояс GMT +4, время: 01:34.


vBulletin® Version 3.6.5.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot
Style crйe par Allan - vBulletin-Ressources.com