Skip to main content
gamedev.net
🔒 Locked

case default: ??

Started by LazyManc Apr 21, 2004 at 1:35 PM 1 replies 450+ views
Original Post
LazyManc
LazyManc
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]
LazyManc
LazyManc
Ah k, thanks, i''m a fool

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.