Archived

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

LazyManc

case default: ??

Recommended Posts

I'm trying to use a default case in my switch statement but I get a compile error: illegal start of expression case default: ^
switch (key)
{
	case Canvas.UP:
		if (player.getVy() > -(Float.createFloat(MAX_PIXEL_RISE)))
		{
			// increase acceleration upward (thrust)				player.setVy(Float.sub(player.getVy(), Float.createFloat(0,THRUST)));

		}
		// move player in Y

		player.setY(Float.add(player.getY(), player.getVy()));
	      	break;
	      	
	case default:
	      	// increase acceleration downward (gravity)

		player.setVy(Float.add(player.getVy(), Float.createFloat(0,GRAVITY)));
	      	// move player in Y

	      	player.setY(Float.add(player.getY(), player.getVy()));
		break;
}
Is default not part of J2ME? [edited by - LazyManc on April 21, 2004 2:39:39 PM] [edited by - LazyManc on April 21, 2004 2:44:23 PM] [edited by - LazyManc on April 21, 2004 2:45:14 PM]

Share this post


Link to post
Share on other sites