Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2
1  Java Game APIs & Engines / J2ME / Re: RMS problem on: 2005-04-25 15:54:48
I tried to close the record store.
But it also saves the record during the game is running, and the record will lost after I close the application.
Huh
Thanks for your reply
2  Java Game APIs & Engines / J2ME / Re: Simulator and real phone on: 2005-04-25 09:15:01
Thanks for your reply
And the memory profiler, there are 5 columns, which one that I should concern?
Thanks a lot!
3  Java Game APIs & Engines / J2ME / Re: RMS problem on: 2005-04-25 09:04:20
I called closeRecordStore() already:
public class GameScreen extends Canvas {
..............
rs = RMSUtil.openRSAnyway(dbname);
.........
public void paint() {
................
rs = RMSUtil.openRSExisted(dbname);
if (rs==null)
{
g.setColor(255, 255, 255);
g.drawString("Your Score "+String.valueOf(spriteScore), 0, 20, Graphics.TOP|Graphics.LEFT);
}
else {
try {
if (spriteScore>=RMSUtil.readInt4RS(rs, r1)) {
r1 = spriteScore;
r1 = RMSUtil.writeInt2RS(rs, spriteScore);
g.setColor(255, 255, 255);
g.drawString("Highest Score" +String.valueOf(RMSUtil.readInt4RS(rs, r1)), 0, 40, Graphics.TOP|Graphics.LEFT);
rs.closeRecordStore();
}
else
{
g.setColor(255, 255, 255);
g.drawString("Highest Score " +String.valueOf(RMSUtil.readInt4RS(rs, r1)), 0, 40, Graphics.TOP|Graphics.LEFT);
rs.closeRecordStore();
}
} catch (Exception e) {}
}
.............
}
.............
..........
}

But it doesnt work, did I have another thing go wrong?
Thanks for your reply


4  Java Game APIs & Engines / J2ME / RMS problem on: 2005-04-24 16:37:21
After I installed an application to my phone, and the application contains a RMS. When I run this application, it can save my highest score.
However, after I closed my application, all data (record) will be lost.
Does it is possible to make a permanent database in the application?
Thanks a lot!
My RMS to open a database is:
public static RecordStore openRSAnyway (String rsname)
{

RecordStore rs = null;

if(rsname.length()>32)
return null;
try {
rs = RecordStore.openRecordStore(rsname, true);
return rs;
} catch (Exception e)
{
return null;
}
}

public static RecordStore openRSExisted(String rsname)
{
RecordStore rs = null;
if (rsname.length()>32)
return null;
try {
rs = RecordStore.openRecordStore(rsname, false);
return rs;
} catch (Exception e)
{
return null;
}
}

public static int writeInt2RS(RecordStore rs, int data)
{
byte []tmp = new byte[4];
tmp[0] = (byte)(0xff&(data>>24));
tmp[1] = (byte)(0xff&(data>>16));
tmp[2] = (byte)(0xff&(data>>Cool);
tmp[3] = (byte)(0xff&(data>>0));
try
{
return rs.addRecord(tmp, 0, tmp.length);
} catch(Exception e)
{
}
return -1;
}

5  Java Game APIs & Engines / J2ME / Re: Simulator and real phone on: 2005-04-24 12:55:30
I discover that when I changed the Splash image to a text (i.e: g.drawString("GameABC", 0, 0, Graphics.TOP|Graphics.LEFT); )
then the problem will not occur.
But when I use an image to replace the text in the title Page, the problem will occur again.
P.S: The splash image only 1.2KB.
Can anyone help me?
Thank you very much!
6  Java Game APIs & Engines / J2ME / Re: Simulator and real phone on: 2005-04-23 12:20:31
The error message occurs every time after the title splash page changes to GameScreen, no matter the title page automatically changes to GameScreen or I click the start command manually.
7  Java Game APIs & Engines / J2ME / Re: Simulator and real phone on: 2005-04-23 10:36:16
Oh, sorry.
1) The error message is " ! Unable to run application"
    The message is displayed after I choose "start" in    the Splash image.
   
2) I use Nokia PC Suite to install my application
3) JAD file contains 3 classes, they are:
   a) GameMIDlet
   b) GameScreen (i.e. Canvas)
   c) RMSUtil (i.e recordstorage)
For the RMS, I create a database called "gamedb" which places in the constructor of GameScreen. And then it will compares the scores with the scores in the database every time. If the score is higher than the database, it will replace database's record.
   d) 11KB of png in res
4) I use Sun's KToolbar and Nokia S40 SDK to develop my application.

Thanks a lot~~
8  Java Game APIs & Engines / J2ME / Simulator and real phone on: 2005-04-22 18:47:01
Hello everybody,
I use simulator to develop my game, but after install the program to my phone (Nokia 3120 and the file size of the game is 24KB), and the real phone tell me cannot be excuted.
So, could you tell me which factors can lead to this problem?   Huh
Thank you very much~
9  Java Game APIs & Engines / J2ME / Random play animation on: 2005-03-25 07:23:57
Hello everybody,
If I want to produce the game that the enemy will attack the player randomly by calling the random integer (randInt) and when the enemy attack the player it will play an animation, that means:
eg)
if (randInt == 0) {
// enemy plays defense animation
}
if (randInt == 1) {
//enemy plays attack animation
}

And in the paint method, I use clipping for the animation.
In the while loop (i.e game loop), when the Thread sleep 100ms, the clipping will change one frame (i.e:repaint), the animation will be fully played until the 6th frame is displayed. However, the problem is after 100 ms, the random and animation will begin at the same time, that means when the attack animation is playing, it will suddenly change to defense animation in the middle of the attack animation and vice versa.
So, can anyone can teach me where the random method should be placed so that it can fix this problem? Huh  Huh
Thanks for your reply~~

10  Java Game APIs & Engines / J2ME / Re: How to insert the game to the phone? on: 2005-03-19 12:48:12
The problem is solved after I opened a new Project and copied all the files from the old Project to the new Project.
Cheesy
11  Java Game APIs & Engines / J2ME / Re: How to insert the game to the phone? on: 2005-03-19 08:59:01
My programs consumes 16KB, and my picture only consumes 6 KB, why it will be 76 KB after packaged?
12  Java Game APIs & Engines / J2ME / Re: How to insert the game to the phone? on: 2005-03-19 08:51:38
But the original jar file consumed 63 KB already  Huh
13  Java Game APIs & Engines / J2ME / Re: How to insert the game to the phone? on: 2005-03-19 08:38:51
My phone contains 447KB spaces, but my jar only consumes about 75 KB, but I don't know why the Application Installer tells me "This application cannot be installed to the phone. The file is too big"Huh??  Huh
14  Java Game APIs & Engines / J2ME / Re: How to insert the game to the phone? on: 2005-03-19 08:29:14
Thanks for your reply~
If I use DKU-5 cable by using Nokia PC Suite, do I need to use "Install Application" for installing the game to the mobile phone?
15  Java Game APIs & Engines / J2ME / Re: How to insert the game to the phone? on: 2005-03-18 14:43:01
Thank you very much~
I just installed the software, but I forgot to buy the DKU-5 Cable Tongue
But it is an easy job, I will buy it tomorrow.  Cheesy
16  Java Game APIs & Engines / J2ME / Re: How to insert the game to the phone? on: 2005-03-18 10:55:11
Nokia: N-Gage,  3120, 7610
Thank you very much~
17  Java Game APIs & Engines / J2ME / How to insert the game to the phone? on: 2005-03-18 10:11:58
After developed the game, how to insert the game to my phone for real testing?
Thank you!
18  Java Game APIs & Engines / J2ME / Re: Time Skipping on: 2005-03-08 11:07:11
I see~ Thanks for David!!
19  Java Game APIs & Engines / J2ME / Re: Time Skipping on: 2005-03-07 00:21:12
Thanks for Mr ribot.
I tried to apply:
int n = ufoMissiles.length;
for(int i=0;i<n;i++) {
 ufoMissilies.doDraw(g);
 Thread.sleep(1000);
}
but it leads to the screen (all elements) hold a second and then run again.
Sorry, I may not provide very detailed information.
In my program, there is a paint method:
public void paint (Graphics g) {
// doing any drawing
..........................
for(int i=0; i < ufoMissiles.length; i++) {
ufoMissiles.doDraw(g);
}
}
And then my class implements Runnable method,
public void run() {
.............
.............

if(ufoMissileCount < ufoMissiles.length &&ufos.isDropBomb()) {
for(int j=0; j < ufoMissiles.length; j++) {
if(! ufoMissiles[j].isAlive()) {
ufoMissiles[j].setX(0);
ufoMissiles[j].setY(ufos.getY() + ufos.getHeight());
ufoMissiles[j].setAlive(true);
ufoMissileCount++;
break;
}
}
}

........}
So, when the condition is achieved, it will draw the ufoMissile, but the ufoMissiles are too closed when they are displayed, so I want to separate them so that they can be displayed one by one.
Thank you.


20  Java Game APIs & Engines / J2ME / Time Skipping on: 2005-03-06 14:46:47
for(int i=0; i < ufoMissiles.length; i++) {
ufoMissiles.doDraw(g);
}

For above code, if I want to draw ufoMissiles[1] after 1 second of drawing ufoMissiles[0], which things that I should do? Huh
Thanks for your reply!
21  Java Game APIs & Engines / J2ME / Re: Mobile 3D tutorial on: 2005-03-06 14:44:07
Thanks for all your helps  Smiley!!!~
22  Java Game APIs & Engines / J2ME / Mobile 3D tutorial on: 2005-03-01 15:30:35
Could any one can tell me where can I find mobile 3D's source code or tutorial on the Internet?
Thanks a lot
23  Java Game APIs & Engines / J2ME / Re: J2ME button control problems on: 2005-02-03 14:17:31
I see
Thanks a lot~
24  Java Game APIs & Engines / J2ME / Re: J2ME button control problems on: 2005-02-03 12:38:18
It works now, thank you very much~ Cheesy
You are very helpful~ Cheesy
However, can you tell me what is the function of
super(true) and super(false)?
Why super(false) can work but not super(true)?
Thanks a lot~ Cheesy
25  Java Game APIs & Engines / J2ME / Re: J2ME button control problems on: 2005-02-02 12:30:04
Thanks a lot, but it also doesn't work.
I am using MIDP2.0 GameCanvas.
I use Sun.com's KToolbar for testing.
I apply this method:
public void keyReleased(int keycode)
{
// switch cases
}
26  Java Game APIs & Engines / J2ME / J2ME button control problems on: 2005-02-01 13:01:31
Hello everybody,
I have a problem about the button (e.g KEY_NUM1, KEY_NUM2 .... etc), Why the buttons are disable (i.e. no action after pressing it) except KEY_STAR and KEY_POUND?
All are disable such as KEY_NUM1, KEY_NUM2 ..... KEY_NUM9.
My program like below:

switch(keycode){
case KEY_STAR:
System.out.println("CDE");
break;
}
switch(keycode)
{
case KEY_POUND:
System.out.println("ABC");
break;
}


Thank you very much~
27  Java Game APIs & Engines / J2ME / How can I set a ID for each clipping? on: 2004-12-14 02:30:44
How can I set a ID for each clipping?
eg)  Huh?? =g.drawRect(x, y, a, b)
Thank you very much!
28  Java Game APIs & Engines / Java 2D / Re: Can Clipping can be rotated? on: 2004-12-12 05:35:02
Oh, thanks!
One more question, if I want to rotate, transform a clip, which method I should use?
29  Java Game APIs & Engines / Java 2D / Can Clipping can be rotated? on: 2004-12-12 00:53:17
Can Clipping can be rotated?
Thank you very much~~
30  Java Game APIs & Engines / J2ME / How can I parse Sprite to Layer? on: 2004-12-10 10:47:33
How can I parse Sprite to Layer?
Thanks a lot~
Pages: [1] 2
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (33 views)
2014-11-22 12:13:56

xFryIx (73 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (40 views)
2014-11-12 21:09:33

kovacsa (65 views)
2014-11-07 19:57:14

TehJavaDev (69 views)
2014-11-03 22:04:50

BurntPizza (67 views)
2014-11-03 18:54:52

moogie (82 views)
2014-11-03 06:22:04

CopyableCougar4 (82 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!