Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 5 6 [7] 8 9 ... 11
  ignore  |  Print  
  MERCury - 2d Game Library | Experimental release in development; test it out!  (Read 22485 times)
0 Members and 1 Guest are viewing this topic.
Offline saucymeatman
« Reply #180 - Posted 2014-03-30 21:59:37 »

Thats the perfect use case for lambdas, your right...

That looks awsome though. Would you have to register each command you want, or could you just call methods by name?
Offline Phibedy

Senior Member


Medals: 8



« Reply #181 - Posted 2014-03-30 22:30:29 »

we also have commandline. "[command] ? " is usefull. it says what type args should have.
[command.part].? shows all commands that start with the command-part (Because we were to lazy to implement a preview  Smiley )
for example:
debug.?
shows debug.log, debug.drawfps, etc.
Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #182 - Posted 2014-03-30 22:33:34 »

@saucymeatman
Calling methods by name infers reflection. I. do. not. do. reflection.

You will name the in-console name of the Command, and then give me a method to run when someone mentions said Command given arguments, if any.

@Phibedy
Pardon me, but I don't really understand what you are saying... Are you saying there is a built-in command line function for Java? Are you referring to System.in? Who is "we?"

EDIT:
Oh, I think I see what you are saying. You mean you want all commands to be listed when you type commandlist.?. I will implement that, now that you mention it!

-wes

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline saucymeatman
« Reply #183 - Posted 2014-03-30 23:50:12 »

Reflection is slow, and allows for alot of misuse, but if this is a debugging took than the person using it knows what they're doing. If its for also intended for an ingame console, you could maybe add in the disabling/enabling of reflection.
Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #184 - Posted 2014-03-31 01:10:48 »

I have very little reflection in this engine; I intend to keep it that way for as long as possible.

I have been thinking about what commands there should be for 'merc.' Here are a few I came up with:

setFpsTarget [target fps]Will cap the FPS at a certain height.
setMouseGrab [true/false]Set whether or not the mouse is to be grabbed.
setVsync [true/false]Set whether or not vertical sync should be enabled.
sleep [milliseconds to sleep]Will stop the program for a given duration.
setTitle [window title]Set the title of the window.
setResizable [resizable]Set whether or not the window should be resizable.
endEnd the game.
setDeltaFactor [delta factor]Set the factor by which delta is to be multiplied.
setFreezeUpdate [true/false]Set the freezing of the logic.
setFreezeRender [true/false]Set the freezing of the screen.

Feel free to name off a few other defaults,
- Wes

Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #185 - Posted 2014-03-31 03:33:52 »



This is a very low quality resize, so let me explain what just happened:
1: I opened a program
2: I typed in "end"
3: The program closed


Sincerly,
- Wes

P.S:
This should all be on GitHub very soon.

Offline kingroka123

JGO Knight


Medals: 26
Projects: 4
Exp: 1 year


Gamer's Helmet


« Reply #186 - Posted 2014-03-31 04:36:16 »

Maybe you should integrate a console window  Like the Portal console that appears when you press the "`" key

Console cmds:
1  
2  
3  
4  
5  
pause - pauses main thread
resume- self explanatory
getScreen - takes a shot of the window with the game in it, not the console widow or any other window  
getCpuData - prints how much cpu the program is using
newInstance - creates a new instance of the program


Just some ideas  Wink

Offline BurntPizza
« Reply #187 - Posted 2014-03-31 17:14:19 »

Not entirely sure what exactly you're trying to accomplish (I'm short on time) but it sounds like you might be interested in the concept of a REPL.
Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #188 - Posted 2014-03-31 20:50:16 »

Will add in a new logging type: console.

@kingroka
Not so sure about cpu, but the rest seems doable! Thanks!

Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #189 - Posted 2014-04-01 04:42:15 »

[snip]

Removed Video.

- Wes

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SwordsMiner

Senior Member


Medals: 2
Projects: 2
Exp: 1 year


Head of the Indie Developing team Revereor.


« Reply #190 - Posted 2014-04-01 15:04:59 »

-snip-
-wes  Wink

*Pinch nose* *Lowers nasal cavity* "Hay goys, weslwlsss heare"

- The one and only, SwordsMiner.
Offline kpars

JGO Wizard


Medals: 75
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #191 - Posted 2014-04-01 15:34:50 »

[snip]

-wes  Wink

Oh my god Wes, you're becoming Cas.

- Jev Smiley

Check out #JGO on EsperNet IRC! | Check out the MERCury 2D Java Game Library! | Also, Check out My Site
Offline SHC
« Reply #192 - Posted 2014-04-01 15:37:35 »

Oh my god Wes, you're becoming Cas.

True  Tongue

Offline saucymeatman
« Reply #193 - Posted 2014-04-02 00:55:13 »

*Lame Joke*

I only wish there was a depreciate or -1
Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #194 - Posted 2014-04-02 03:08:11 »

@saucymeatman:
This. And if it gets below a certain threshold, it gets a spoiler! Smiley

@SwordsMiner:
Stop.

@Everyone:
Damn it, I'm not Cas! Angry

Also,
Let's Get Back On Topic!

I am thinking of making a full blown video describing all of the console system, though it's just an idea. I will also add in variables soon as well. MAYBE you will be able to do math, but I am not sure if I can implement that in time.

-wes Cranky
See?! Its a different emoticon

Offline BurntPizza
« Reply #195 - Posted 2014-04-02 03:25:17 »

A bit late, but I saw your (wes) post at the top of this page, there is no need for reflection, what you want is the (aptly named, no?) Command Pattern. Example usage:

1  
2  
3  
4  
5  
6  
7  
//pseudocode

while(input.hasMore()) {
      String cmdName = input.getNextToken();
      Object[] args = input.processUntilEndOfLine();
      commandMap.get(cmdName).execute(args);
}



I will also add in variables soon as well. MAYBE you will be able to do math

Again, sounds like you want a REPL.
Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #196 - Posted 2014-04-02 03:35:58 »

Actually, you may be right. I mean, it will get a bit more complex than that when I add in manuals, but that's a great idea! You just made the parser less confusing. Up until this point, I was using solely '.' for syntax separation. +1!

- Wes

Offline BurntPizza
« Reply #197 - Posted 2014-04-02 03:39:59 »

You could also use Janino and use Java itself as your "scripting language," but it's likely overkill/not intuitive enough for users.
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #198 - Posted 2014-04-02 03:49:53 »

Well I haven't posted in this thread for a while!

Today I'm proud to present to you the new and improved Spritesheet class! Well what does it do, you may ask? Its simple really! First, you obtain or create a spritesheet, then you create a special text file that is parsed by MERCury in a specific and secret way. The information in that file is then used to split up the spritesheet into renderable sub-textures so that you (the MERCury user!) can use spritesheets with style and efficiency. But what's the best part about the new Spritesheet class? Well, read on to find out more!

First lets talk about Spritesheets. Basically, you need two files. A image file (your spritesheet), and a specially designed text file. Lets take a look at the code:
1  
sheet = Spritesheet.loadSheet(Loader.loadFromClasspath("com/radirius/merc/test/tiles.txt"), Loader.streamFromClasspath("com/radirius/merc/test/tiles.png"));

This line of code simply loads a spritesheet. The two parameters are the "special text file", and the spritesheet image file, respectively. After you have done this, you can render a sub-texture from that spritesheet like so:
1  
g.drawTexture(sheet.getTexture("Grass"), 10, 10, 128, 128);


Incredibly easy! Now lets look at the special text file:
1  
2  
3  
HEADER 16
Void 0 0
Grass 1 0


Lets break this down.

HEADER 16 basically means that on one side of the spritesheet, we have 16 sub-textures. Its VERY important you have a "square" spritesheet with the same width and height or else the entire Spritesheet class will fail Sad

Void 0 0

"Void" is the name of the tile. 0 0 specifies that the sub-texture resides at position 0, 0 in the spritesheet. Positions are counted in increments of 1. Take a look at this example spritesheet:


The Grass tile is at (according to our special text file) position 1, 0. On the actual spritesheet you can see that the grass tile (the green square) is 1 tile over from the origin (in the top left hand corner). So, logically, the stone tile (the grey square) would be at position 2, 0.

I will develop a GUI based tool that will speed up the process of creating these special text files, but for now they have to be created by hand! I am also aiming to support non-square sub-textures, but that will be down the road.

On another note, I have also added the basics of IO with text files! More on that later though when it is actually complete.

-Team Radirius (we have a new team name!)

Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #199 - Posted 2014-04-02 04:42:42 »

Well, other than variable support, the console is pretty much done!
I am really liking the results so far.

Signing off for tonight,
- Wes

Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #200 - Posted 2014-04-06 06:47:12 »

Welp guys, I finally finished most of the Developers Console. It is all on GitHub for you guys to try out. I am so far quite happy with my results so far. Thus, the only logical way to share this news is by naming off every single feature of it to make myself feel like I did more work than I actually did. Expect many a bugs, misspellings, and forgotten content by the way!



- Basic Commands: you can enter in small little commands with no arguments!

1  
[Command List] [Command]

As an example, let's end the program from the console.
1  
merc end


- Argumentative Commands: you can enter a command along with some arguments!

1  
[Command List] [Command] [Argument 1] [Argument 2] [And so on...]

Let's try echoing our own opinions to ourselves!
1  
2  
merc echo MERCury_Is_Awesome
CONSOLE: MERCury_Is_Awesome


- Quotation Marking: you can add in Strings of characters that will not be parsed, just loaded in regardless of what they are. A space inside of quotation marks will not separate the argument into two, but just add in a space to the argument.

1  
2  
merc echo "Hello World!"
CONSOLE: Hello World!


- Escaping Characters: you can make a quotation mark not do anything. You can basically make any single character not parse. Just put a '\' in front!

1  
2  
[Command List] [Command] "My name is \"Wesley\""
CONSOLE: My name is "Wesley"


- Variables: you can inject variables into your commands. Just remember the curly braces (which can also be escaped)!

1  
{[Command List] [Variable]}

These can also have arguments to feed into the code:
1  
{[Command List] [Variable] [Argument 1] [Argument 2] [And so on...]}

For an example, lets print out our frames per second!
1  
2  
merc echo "The FPS is: "{merc fps}"; which is indeed rad."
CONSOLE: The FPS is: 60; which is indeed rad.


- Manuals: now Command List developers will have the ability to have in-console documentation on their product. Let's see the basic types:

1  
2  
// Shows the general Console guide
?

1  
2  
// Shows the Command List's manual
[Command List].?

1  
2  
// Shows the Command or Variable's manual
[Command List] [Command or Variable].?




And that is about all I have done so far! What do you think of it? Is it good, bad, in between? Please give me feedback on this, as I want this feature to be as good as possible!

Thanks,
- Wes

Online trollwarrior1
« Reply #201 - Posted 2014-04-06 09:01:08 »

Console is pretty awesome, though I don't see a use for console in 2d game engine, which is supposed to be used with code anyway (Is it gonna be like LWJGL or Unity?).
Offline kpars

JGO Wizard


Medals: 75
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #202 - Posted 2014-04-06 09:33:11 »

Cheating! \o/

merc noclip true


- Jev

Check out #JGO on EsperNet IRC! | Check out the MERCury 2D Java Game Library! | Also, Check out My Site
Offline kpars

JGO Wizard


Medals: 75
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #203 - Posted 2014-04-06 09:34:36 »

Maybe you should integrate a console window  Like the Portal console that appears when you press the "`" key.

This is what I plan on adding once I get the GUI stuff "done!" Pointing

- Jev

Check out #JGO on EsperNet IRC! | Check out the MERCury 2D Java Game Library! | Also, Check out My Site
Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #204 - Posted 2014-04-06 16:03:27 »

@trollwarrior1
You are missing the point. This is not for making the game, but for modifying it on the fly. Say you want to test something, but don't want to close the window so you can edit a single (or multiple) variable, and load the game up again. You can just change that variable to your liking on the fly, and when you find the golden spot, go back into the code and change it. It is good for just testing out certain things, like constants, and things like that. And say you want to find what is behind that wall, to check if everything spawned okay? Well, you can just noclip through it!

Of course, there is also the cheating implications, which Jev will have some fun with  Roll Eyes.

-wes  Smiley

Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #205 - Posted 2014-04-08 00:58:19 »

Well guys, we are approaching a Beta release, in which we will vigorously bug test by making games.

  • Rename-
    No, I am not going for the obviously superior name 'MERC.ury.' I mean we will more re-classify it. It is currently called an engine, and, by Jev's definition:
    Quote
    [A Game Engine] is a program that acts as a game that is to be completed with assets and gameplay. A Game Library only gives you the basic components required to make a game.
    This is highly misleading as to what I intended for the engine. I think I did not know the difference between an engine and a library back then. Now that I do, I realize that we were aiming more for a library. Thus the rename.
  • New Logo-
    Because we changed the name, and the current logo is a bit boring. It is good, but not great.
  • GUI-
    Someone on our team (not naming names), has been on vacation for a bit. He is back as of today, and can continue his work on the GUI. So it's a start!
  • Rewrite documentation (as of now, it is utter crap)-
    It is just unorganized. I hate how it turned out so far, and need to restart most of it, taking heavy inspiration from other game engine documentation. From the beginning, I have been doing more a tutorial n00b spoonfeed approach. Now, I will go for a more straight, dry documentation. More on the docs later.

None of this is TOO difficult, but more time consuming. But there is one thing I would like a few opinions on, if you don't mind: how should the docs be ordered? I have no clue as to how to approach the engine. Start with Boilerplate code, of course. Then do we just go to graphics, sounds, plugins, and utils? It just makes me

In case we have a 'skimmer' here: TL;DR Beta is coming soon; we need your ideas on how the documentation should be done!

Thanks,
-wes

Offline Slyth2727
« Reply #206 - Posted 2014-04-08 01:20:34 »

I would like to contribute to the logo part. I consider myself decent at design.

Are you guys actually planning for this to be a real library that the public will consider using, like libGDX, or is it more of a pet project?

Was I before Chuang Tzu who dreamt about being a butterfly, or am I now a butterfly who dreams about being Chuang Tzu?
Offline kpars

JGO Wizard


Medals: 75
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #207 - Posted 2014-04-08 01:25:12 »

Are you guys actually planning for this to be a real library that the public will consider using, like libGDX, or is it more of a pet project?

Yes.

- Jev

Check out #JGO on EsperNet IRC! | Check out the MERCury 2D Java Game Library! | Also, Check out My Site
Offline wessles

JGO Wizard


Medals: 64
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #208 - Posted 2014-04-08 01:27:38 »

@Slyth2727
This is my dream project. You see, I am not that good a game developer. I take more joy in making the tech behind games than actually making games. Thus this is really rewarding for me, regardless of whether or not you use it, just because this is a project I can pour tons of effort into. And when I do get more into making games themselves, this engine will help my pet-peeve of only using my own code...

In addition to what Jev has said, just email me at wesley.laferriere@gmail.com.

@kpars
Please Jev, do not tell them what you are doing. Leave it as a surprise for the Beta release.

Offline kpars

JGO Wizard


Medals: 75
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #209 - Posted 2014-04-08 01:29:06 »

Alrighty. Will hide my classified government documents starting... NOW!

- Secret Agent Jev

Check out #JGO on EsperNet IRC! | Check out the MERCury 2D Java Game Library! | Also, Check out My Site
Pages: 1 ... 5 6 [7] 8 9 ... 11
  ignore  |  Print  
 
 

 

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

The first screenshot will be displayed as a thumbnail.

pw (22 views)
2014-07-24 01:59:36

Riven (20 views)
2014-07-23 21:16:32

Riven (17 views)
2014-07-23 21:07:15

Riven (20 views)
2014-07-23 20:56:16

ctomni231 (48 views)
2014-07-18 06:55:21

Zero Volt (44 views)
2014-07-17 23:47:54

danieldean (35 views)
2014-07-17 23:41:23

MustardPeter (38 views)
2014-07-16 23:30:00

Cero (53 views)
2014-07-16 00:42:17

Riven (52 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!