• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

nowan

[java] This code works in appletViewer but not browser, please help...

11 posts in this topic

The following code which comes from my run() method works fine in appletViewer but not in my IE 5.0 browser. The code is for a simple countdown clock during which you must complete the game. The clock displays but will not countdown when tested in the browser. *********************************************** if(secs>0 && gameStart==1 && gameOver==0) { secs--; // clock countdown } if(secs<=4 && secs > 0 && TimersoundPlayed==0 && gameOver==0) { TimerSound.play(); TimersoundPlayed=1; } if(secs<=0) { gameOver=1; } *********************************************** What do you think is going wrong?
0

Share this post


Link to post
Share on other sites
That''s not really enough code, but try compiling with the option -target 1.1 , you might be using some 1.2 code.
0

Share this post


Link to post
Share on other sites
Thanks lilspikey, but I''ve tried what you suggested with no success. Any other ideas?

Thanks
0

Share this post


Link to post
Share on other sites
Well, if I look in the Java console part of the browser I do get the following message but I still get it if I comment out the code I posted and re-compile without it.

java.lang.NoSuchMethodError: java/awt/Component: method getWidth()I not found
at Connections.run
at java/lang/Thread.run
0

Share this post


Link to post
Share on other sites
Also, I forgot to mention, if I use HTML converter everything works perfectly but this means that the end user has to download a plug-in I think, which kind of counters the whole point of me using Java for a web-based game.
0

Share this post


Link to post
Share on other sites
If you look in the java api documentation, you will see that getWidth() has only been a method of component since java 1.2. Hence under IE 5.5 (which ONLY supports java 1.1) the method does not exist, hence the NoSuchMethodError.


Use getSize().width instead.
0

Share this post


Link to post
Share on other sites
Im actually having a similar problemo in my own applet using awt (no swing).

The applet works fine in applet viewer.
when i try it in a browser window, it loads up and displays the background image, but its as if its gone through init() (cos it goes through paint() once), but wont go through run() where the core logic lies (yes i know, i wouldve taken a more OO approach, but the assignments due pretty soon and i pannicked, and now the code looks like straight c), and the applet just sits still doing nothing.

it does handle action events, such as clicking on buttons and checkboxes, while in the browser, BUT it only refreshes to the new stuff added by the action when the window is scrolled down or whatever, when it should repaint in one of the timers that sends a repaint 33 times every second.

My conclusion? the threads (run, and extra timers) arent running...why?

here in castle camelot we eat ham and jam and spam alot!
0

Share this post


Link to post
Share on other sites
Maybe the extra thread have thrown exceptions and died. Do you get any error messages in the browsers java console?
0

Share this post


Link to post
Share on other sites
Well that''s what is happening with my applet too. It seems to go through run() just the once and that''s it. The applet works fine otherwise and responds to mouse clicks with all the right movements and displays.
0

Share this post


Link to post
Share on other sites
Well that''s correct! Run is called once!

declare you run like this!


public boolean applet_active = true;
public void run()
{
while(applet_active) do_main_loop();
}

private void do_main_loop()
{
blah blah blah blah.....
rubarb rubarb rubarb.....
}



:-)

0

Share this post


Link to post
Share on other sites
Well, sometimes it just takes someone to come along and state the hidden obvious Thanks a million Chaoslab, everything now hunky cool!

nowan
0

Share this post


Link to post
Share on other sites