Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (714)
Games in Android Showcase (214)
games submitted by our members
Games in WIP (787)
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 3 ... 71
1  Discussions / Miscellaneous Topics / Re: Programming in schools - opinions? on: 2017-02-24 12:20:42
@Abuse, I think all tests should allow laptops and spreadsheets, mostly for the ability to easily save and see intermediate results which is hard in a calculator, and to be able to see the history of working in prior cells' working to spot an error.

Are we imagining different examination techniques?
I'm still imagining paper examinations where the calculator simply supplements the written word; it's the responsibility of the student to record their working on the examination paper.

What you're suggesting sounds like a transition to completely digital examination, and while that paradigm shift is in the works, it's yet to become mainstream here in the UK.
I do agree though; digitally recording all intermediate working would be a much better way of evaluating a student's level of understanding, but spreadsheets are not the ideal tool for that purpose.

Quote
and regular * not x and / not รท symbols which are encountered all over the workplace and in everyday life.

Mathematical operator symbology is indeed a mess, and the pervasiveness of competing Computer Science symbology has only muddied the water further.
That's a whole different topic though.
2  Discussions / Miscellaneous Topics / Re: Programming in schools - opinions? on: 2017-02-23 16:30:15
Just to be clear, when I say "teaching programmin" in an elementary school, I expect to make it accordingly, that means no gradle or complex projects, but simple exercises, like moving an character through a 2d tiled-map. Something that also attract their attention and is, somehow, fun.

Teaching programming should be, indeed, teaching how to elaborate and process algorightms

Precisely.

I introduced my 5 year old nephew (mad on Minecraft) to code.org's Minecraft Hour of Code, and he found it incredibly rewarding.
Programming (in all its guises) is already prevalent throughout our society, and will be even more so in the future; introducing it early as a 'play thing' is vital for future learning.

It's hardly a new concept; anyone remember this:

Or this:
3  Discussions / Miscellaneous Topics / Re: Programming in schools - opinions? on: 2017-02-23 13:33:52
On a related note, I always think it's incredibly dumb how students are forced to use such limited calculators in exams. All exams in math related subjects should allow spreadsheets or mathematica or Google or a programming language on a laptop.

At what level are you talking about?

No highschool student would ever need access to such powerful tools to solve the problems they're being examined on.
Moreover, having access to such tools would change the focus of the examination; you'd no longer be testing them on their understanding of the topic, but on their ability to use the tools.
4  Discussions / Miscellaneous Topics / Re: Programming in schools - opinions? on: 2017-02-23 02:31:47
Programming is logical problem solving; it's an essential life skill for everyone.
It can (and should) be taught to all young children.

Coding on the other hand (and which I suspect is what the OP is actually talking about?), is a far more specialised discipline that not everyone can grasp to the same level.
So while you don't anticipate every pupil who is taught coding at school, will go on to use it in their professional life, they will know of its existence & thus have an understanding of how computers & technology work.

The parallel would be the car; everyone uses them, most know how they work, but very few would dare attempt anything but the most superficial of servicing.

Thankfully both programming & coding have been a part of the national curriculum here in the UK for some time, so I guess someone in authority knows where society & technology are headed.
5  Game Development / Newbie & Debugging Questions / Re: Peculiar stacktrace and an error I've never seen before on: 2017-02-21 03:09:43
unless this person has a software running that does exactly that, which I wouldn't assume.

Yeah, I had that thought today too.

Perhaps you've detected someone messing around with your game in a dev environment, for some nefarious (or otherwise) purpose.
6  Game Development / Newbie & Debugging Questions / Re: Peculiar stacktrace and an error I've never seen before on: 2017-02-19 19:37:24
1st place I'd look would be JAVA_TOOL_OPTIONS or _JAVA_OPTIONS environment variables for anything untoward.
Presumably you log & report the values of these on launch?
7  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Advantages of Ant? on: 2017-01-29 23:45:43
We simply do not allow any external dependencies in a build, period. The entirety of the repository must be sufficient to produce all artefacts.

Cas Smiley

Wow!

So you've got an entire VM image containing OS & apps checked in?  Grin
8  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Advantages of Ant? on: 2017-01-26 16:49:53
IME having external dependencies in a build is a bit like building your castle on sand. The build must always succeed. Discuss.

So you're advocating the inclusion of external packages with your build, rather than having them pulled from a central repository?

I'm of the opposite opinion; pulling from a central repository minimizes data duplication, and therefore fewer places for mysterious build errors to creep in.
Either you get the correct version of the correct library, or you get nothing. Fail fast.
9  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Advantages of Ant? on: 2017-01-25 16:49:27
Surprised nobody has mentioned Maven; from my limited experience with it, it's Ant done right.
Great Eclipse integration too, and you can host your maven repository directly on github.

Takes a little while to get your head around the concepts, but the way dependencies are handled makes it a dream to use (especially when you're pulling from others' Maven projects)
10  Game Development / Newbie & Debugging Questions / Re: getting rid of "instanceof" on: 2017-01-14 23:31:18
@cylab - Your post (reply # 29) showed me that you can use a class type as a key in a HashMap, so thank you for that.  Pointing I wanted to do that one point and didn't know it was actually possible. Also, I like the implementation you suggest as it is very clean. I'll probably try that at some point, but for now this implementation is working well.

I read in several spots on the thread that casting might smell of bad design, which I do in places, namely where a state is assigned to a Mob:
1  
2  
3  
4  
5  
6  
@Override
   public MobState init(Mob m) {
      brick = (Brick) m;
      brick.setCol(0xffff00);
      return this;
   }


The problem is that I can't assign the type and recognize the subclass methods without casting. It doesn't generate a compile time error if you pass the wrong type as an argument, but I have tested it and it will throw a ClassCastException and print a stack trace. So I was wondering if this is considered bad design and if there is a better approach? Thank you all for contributing to the thread- your expert advice has been very enlightening!

In that example, it looks like your MobState super-class should be a generic type, with the init method using the class' parameterized type for its parameter.
Something like:

1  
2  
3  
4  
abstract class MobState<T> {

public abstract MobState init(T m);
}


The return type could probably be parameterized too, though I've no idea what your MobState / Mob class heirarchy looks like.
11  Game Development / Newbie & Debugging Questions / Re: Type checking an init method on: 2016-12-27 15:44:54
I'd advise that you don't get yourself wrapped up in unnecessary Generics boilerplate.

What value is this bringing to your code?
Is it reducing, or increasing, complexity & readability?
12  Game Development / Game Play & Game Design / Re: The best way to normalize chances in a two-player game? on: 2016-12-09 23:14:42
IMO the large 1st-player advantage given by the rules necessitates multiple games for each level, with serve alternating between players.
Victory would then require a 2 game lead (break their serve & hold yours).
Basically Tennis tie breaker.

1st serve wouldn't matter, so decide it with a hidden coin toss.

It'd elongate each level, but it seems to me all the other alternatives are radical departures from the classic game.
13  Game Development / Newbie & Debugging Questions / Re: Concurrent Modification when changing maps? on: 2016-12-07 00:34:58
I am also not using multiple threads.

The JVM begs to differ:
Quote
I get a concurrent modification error ...

Not strictly true.

Quote
Note that this exception does not always indicate that an object has been concurrently modified by a different thread. If a single thread issues a sequence of method invocations that violates the contract of an object, the object may throw this exception. For example, if a thread modifies a collection directly while it is iterating over the collection with a fail-fast iterator, the iterator will throw this exception.

The provided code fragment could be doing this, but there's no way for us to know if collisionObjectLayer.getObjects() is the same Collection as ItemManager.itemList
14  Game Development / Newbie & Debugging Questions / Re: Concurrent Modification when changing maps? on: 2016-12-06 19:49:44
I am also not using multiple threads.

So where else is isLoading used?
If there aren't other threads referencing it, then it's completely superfluous.
If there are other threads referencing it, then it's almost certainly unsafe.
Either way, it's a pointer to a problem in design or understanding.

Rather than giving us a useless fragment of code, and having us guess at the cause, stick your code on github in its entirety so we can tell you precisely what the problem is.

Alternatively, learn to use a debugger.
15  Game Development / Newbie & Debugging Questions / Re: Concurrent Modification when changing maps? on: 2016-12-06 12:09:05
Looks to me like you're attempting to use the isLoading flag as a mutex.

That's unlikely to be thread safe.
You need to use proper synchronization.
16  Discussions / Miscellaneous Topics / Re: Humble monthly keys on: 2016-11-11 15:48:28
Would much appreciate Rebel Galaxy please!  Pointing

Thinking about it, I have a few keys of my own I could contribute to this thread...
17  Game Development / Game Play & Game Design / Re: Layout for movement buttons in a RPG mobile game on: 2016-11-10 17:05:36
You've got a touchscreen, you should use it to your advantage.
Rather than emulating a traditional d-pad, why not have the hero move towards where ever the user presses on the tilemap?

Of course this might not be suitable for your game design, nor might it be precise enough for the scale of your tilemap.
Still, it'd be a real difference in UI design, rather than the 3 rather superficial alternatives you've presented in the OP.
18  Game Development / Newbie & Debugging Questions / Re: protect files on: 2016-09-30 11:26:56
I'm not entirely sure what you're asking, but in a JAR's manifest you can specify that specific packages are sealed.

Classes defined in a sealed package must be archived within the same JAR; this prohibits 3rd party code from declaring itself a member of the sealed package, thereby preventing access to its package-private methods & members.

https://docs.oracle.com/javase/tutorial/deployment/jar/sealman.html

Whatever it is you're trying to achieve, using the default package is NOT the solution; NEVER use the default package.
19  Game Development / Newbie & Debugging Questions / Re: Point changing for some reason on: 2016-09-27 08:52:57
1  
public Cell(Point location)


Java passes references, and Point is a mutable type.
Any changes (outside this class) made to the Point instance that you pass into the constructor will alter the value returned by Entity#getLocation().

Java actually passes by value, it never passes by reference.

It may look like it passes by reference but it is actually by value.

This doesn't change the answer though.

I didn't say it passes by reference; I said it "passes references", and yes, it passes references by value.

However, this is semantic complexity that is entirely beyond the level of understanding demonstrated by the OP, hence why I avoided the topic.
20  Game Development / Newbie & Debugging Questions / Re: Point changing for some reason on: 2016-09-26 23:25:27
1  
public Cell(Point location)

Java passes references, and Point is a mutable type.
Any changes (outside this class) made to the Point instance that you pass into the constructor will alter the value returned by Entity#getLocation().

A superficial way of fixing this would be to replace:
1  
super.location = location;

with:
1  
super.location = new Point(location)


There's a 2nd problem with your code; your Entity class has a protected member:
1  
protected Celltype cellType

while your Cell subclass has a private member of the same name.

So the assignment in your Cell constructor:
1  
cellType = MasterGame.cellTypes.get(random.nextInt(MasterGame.cellTypes.size()));

...is assigning a value to the member Cell#cellType.

While the Entity method:
1  
2  
3  
   public CellType getCellType() {
      return cellType;
   }

...will be returning Entity#cellType.

I doubt this is what you intend.
21  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibZ - 2D Java Game Library on: 2016-09-26 01:19:15
It isn't that slow.

In the order of 1000x slower than hardware accelerated drawing.
That *is* what I'd consider really slow.
22  Game Development / Newbie & Debugging Questions / Re: Directional collisions with rectangles and circles on: 2016-09-19 12:11:43
Breakout is a simple enough game to use swept area collision detection; the maths for both swept circle<->line segment and swept circle<->swept circle are well documented.

Such a technique would give you perfectly accurate collision detection, unlike a rigid body physics engine with penetration & restitution, which sacrifices precision for universality.

Though your approach should really depend on how you want the ball to behave; anything more than perfect elasticity, and a physics engine might be the better choice.
23  Java Game APIs & Engines / OpenGL Development / Re: Vertex cache shenanigans on: 2016-09-13 01:57:25
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
Batch size test invocations: 130056 / 50331648
Calculated vertex cache batch size: 387

Cache size 1 invocation test: 130056 / 50331648
Cache size 2 invocation test: 260112 / 50331648
Cache size 3 invocation test: 390168 / 50331648
Cache size 4 invocation test: 520224 / 50331648
Cache size 5 invocation test: 650280 / 50331648
Cache size 6 invocation test: 780336 / 50331648
Cache size 7 invocation test: 910392 / 50331648
Cache size 8 invocation test: 1040448 / 50331648
Cache size 9 invocation test: 1170504 / 50331648
Cache size 10 invocation test: 1300560 / 50331648
Cache size 11 invocation test: 1430616 / 50331648
Cache size 12 invocation test: 1560672 / 50331648
Cache size 13 invocation test: 1690728 / 50331648
Cache size 14 invocation test: 1820784 / 50331648
Cache size 15 invocation test: 6372742 / 50331648
Cache size 16 invocation test: 11184822 / 50331648
Cache size 17 invocation test: 50331648 / 50331648

Results:
  Renderer: AMD Radeon HD 5800 Series
  Calculated vertex cache batch size: 387
  Cache size: 16


AMD HD 5870 1GB. (Crimson 16.2.1)
24  Java Game APIs & Engines / OpenGL Development / Re: *AMD testing needed!* Vertex cache shenanigans on: 2016-09-12 16:38:05
<snip>

1  
2  
3  
4  
Results:
  Renderer: AMD Radeon HD 5800 Series
  Calculated vertex cache batch size: 2147483647
  Cache size: -1


Yep, same failure on my AMD HD 5870 1GB. (Crimson 16.2.1)
25  Game Development / Networking & Multiplayer / Re: Why Threads for the Client on the Server? on: 2016-09-10 02:16:26
Have a read up on blocking and non-blocking I/O.
26  Discussions / General Discussions / Re: Pokemon GO 'augmented reality' game on: 2016-07-13 18:04:22
Few would consider a child scribbling all over the Mona Lisa to be augmentation; just sayin'  Grin
27  Game Development / Newbie & Debugging Questions / Re: getters and setters vs public vars on: 2016-07-10 11:10:32
Every
...
have sense ^^

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
public void Proc_Collis(){
   Return_Collis.Reset_Data();//Always first
   if(!Check_Colis()){
      return;
   }
   Return_Collis.have_Collis = true;
   ///calculate Pos_Offset + Velocity
}
class Return_Collis{
   static public boolean have_Collis;
   static public Vec3 Velocity;
   static public Vec3 Pos_Offset;

   static public void Reset_Data(){
      have_Collis = false;
      Velocity = new Vec3();
      Pos_Offset = new Vec3();
   }
}


If I encountered that in a code base, I'd run for the hills.
28  Game Development / Newbie & Debugging Questions / Re: getters and setters vs public vars on: 2016-07-09 11:11:36
a variable like "speed" in your example would be good (in my opinion) to make public. This is because you cant do:
player.speed++;
player.speed *= 10;
player.speed %= 30;
etc...
easily with getters and setters

Encapsulation. A class of objects should manage its own state.

If you've got code all over the place directly manipulating the speed of the player (either the member directly, or through getters/setters), then you've failed to properly encapsulate your code.
29  Discussions / Miscellaneous Topics / Re: Scripting Language on: 2016-07-09 10:55:06
That makes sense. Thanks for your reply.

This lead me to a blog which details out some nice information

It detailed out for me two types of VMs: Stack and Register. I like the register based one, which was obviously more promoted. I rarely deal with stacks anways.

As of now I am just messing around trying to discover how things work more down deep. Everyone eventually writes the 'basic' language at some point. Aha Smiley

That blog is good, though it doesn't address the most important advantage of a stack-based VM; portability.

A stack-based VM can be run on a processor with any number of registers.
Equally a stack-based VM can be easily transposed onto a register-based VM. (as demonstrated by the translation of java bytecode into dalvik bytecode)

Essentially a stack-based VM is more abstract, and thus more flexible.
True it leaves more work for the JIT to do, but (beyond the most naive of implementations) doesn't mean it's necessarily less efficient.

Rather than attempting to write your own VM, I'd suggest just studying Java's VM specification. It's an excellent document:

https://docs.oracle.com/javase/specs/jvms/se7/html/index.html
30  Discussions / Miscellaneous Topics / Re: Scripting Language on: 2016-07-09 02:44:43
1  
2  
3  
push 32
push a
add


Does add pop 32 and pop a from the state? Or should future pushes pop the second push in that pop has to be ran twice to edit push 1? Or am I getting this process wrong?

If we're talking about a stack based (virtual) machine:
- the push instruction would take one operand (in your example 32 or a) and push it onto the stack.
- the add instruction would pop the top 2 values from the stack, add them together, and place the result back onto the stack.

There are many resources on the Internet explaining how basic stack based VMs work.
Pages: [1] 2 3 ... 71
 
Rule (82 views)
2017-03-19 12:43:22

Rule (69 views)
2017-03-19 12:42:17

Rule (78 views)
2017-03-19 12:36:21

theagentd (89 views)
2017-03-16 05:07:07

theagentd (89 views)
2017-03-15 22:37:06

theagentd (85 views)
2017-03-15 22:32:18

theagentd (83 views)
2017-03-15 22:31:11

ral0r2 (138 views)
2017-03-03 11:52:41

ral0r2 (136 views)
2017-03-03 11:42:24

Archive (316 views)
2017-02-27 19:41:49
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!