Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Inline syntax highlighting tag  (Read 2326 times)
0 Members and 1 Guest are viewing this topic.
Offline Best Username Ever

Junior Member





« Posted 2012-12-05 00:08:03 »

We need a version of the code tag that does syntax highlighting as inline text. For example, I might like to say "You can write add on to a list of numbers by using stringBuilder.append(", ").append(number); or just stringBuilder.append(number); if it's the first number in the list." Or maybe "You typed array[index] instead array[index - 1]." Code tags break up a paragraph even if it's only one line.

So... We can haz
...
tag, please?
Offline theagentd
« Reply #1 - Posted 2012-12-05 01:20:24 »

+1 from me.

Myomyomyo.
Offline ReBirth
« Reply #2 - Posted 2012-12-05 01:40:12 »

There's one more thing annoys me when posting code, tab.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online Riven
« League of Dukes »

JGO Overlord


Medals: 793
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #3 - Posted 2012-12-05 01:47:26 »





You can write add on to a list of numbers by using
stringBuilder.append(", ").append(number);
or just
stringBuilder.append(number);
if it's the first number in the list.





You typed
array[index]
instead of
array[index - 1]
.





The problem is most likely caused by how you calculate your tile positions in combination with float rounding.

For example, mathematically equal multiplications and additions might not equal the exact same value. For example
x = y*2 + y;
might not give the exact same result as
x = y*3;


The reason why I took this exact example is because that's most likely what you're doing for your sprite positions (or what LibGDX does). Consider a tile, it goes from
x1 = tileX * tileSize;
to
x2 = tileX * tileSize + tileSize;


However, the tile next to it at index tileX+1 will start at
x1 = (tileX + 1) * tileSize;


Now there's a chance for those two to be different since
tileX * tileSize + tileSize
may not be equal to
(tileX + 1) * tileSize


Rounding the values therefore eliminates the problem, but is not a very elegant solution. =S





System.out.println("Only because you asked so kindly.");
Kiss


Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline theagentd
« Reply #4 - Posted 2012-12-05 01:53:47 »

Riven.getInstance().giveMedal();


Yes, Riven is a singleton! Who knew? =D

Myomyomyo.
Online Riven
« League of Dukes »

JGO Overlord


Medals: 793
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #5 - Posted 2012-12-05 02:02:11 »

1  
int underscoresNowSupported = 1_000_000L;

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Best Username Ever

Junior Member





« Reply #6 - Posted 2012-12-05 02:03:19 »

Much better. Smiley
Offline Regenuluz
« Reply #7 - Posted 2012-12-05 07:15:40 »

Mhmm, inline code. Nice addition to the feature set! Smiley
Offline ReBirth
« Reply #8 - Posted 2012-12-05 11:52:48 »

Shouldn't it
1  
long underscoresNowSupported = 1_000_000L;

Offline sproingie

JGO Kernel


Medals: 202



« Reply #9 - Posted 2012-12-05 19:05:55 »

Widening conversion baby, doesn't matter if the literal's already an int.  And as you can see, the highlighter picks up the L (I imagine it just meant adding underscore to the token regex for numbers)
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 345
Projects: 3
Exp: 5 years


I'm the King!


« Reply #10 - Posted 2012-12-05 20:07:29 »

YES! Very useful feature!
Thanks Riven!

Online Riven
« League of Dukes »

JGO Overlord


Medals: 793
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #11 - Posted 2012-12-06 16:17:04 »

Ha! Enough medals for this month. See ya in 2013, slackers!

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Dwinin (21 views)
2014-09-12 09:08:26

Norakomi (55 views)
2014-09-10 13:57:51

TehJavaDev (65 views)
2014-09-10 06:39:09

Tekkerue (32 views)
2014-09-09 02:24:56

mitcheeb (54 views)
2014-09-08 06:06:29

BurntPizza (38 views)
2014-09-07 01:13:42

Longarmx (24 views)
2014-09-07 01:12:14

Longarmx (30 views)
2014-09-07 01:11:22

Longarmx (28 views)
2014-09-07 01:10:19

mitcheeb (36 views)
2014-09-04 23:08:59
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!