Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
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   
  Show Posts
Pages: [1] 2 3 ... 9
1  Discussions / General Discussions / Re: FlipFlop - Examn f(CLK) on: 2014-09-15 04:11:19
we never did questions like this, so I tried to adapt questions that we did to this.

From google searching you are right. its Frequency division. which we never learnt about.

So sorry Longarmx, but I think this full theory could also help Andre Lopes, in the understanding of how JK Flip Flops work.

so the correct answer is actually 3.75 Hz. (which from my little research only works for toggle flip flops I believe? (where a JK flip flop with J and K both are 1 is a toggle) )

and all my replies is on how Toggle works in a JK Flip Flop.
2  Discussions / General Discussions / Re: FlipFlop - Examn f(CLK) on: 2014-09-15 03:52:47
the clock is not required, as the clock only means how often it is executed, in this case it is a falling edge executed, and by the little timing diagram, is it executed straight away.

there for the JK flip flops are currently active.
3  Discussions / General Discussions / Re: FlipFlop - Examn f(CLK) on: 2014-09-15 03:49:55
I believe it would be 5 defined by a high = 5Hz and low = 0hz,

where 60Hz is a high, so it starts high, goes low, goes high, goes low and finishes on the last flip flop as a high.

now work out what the value of a high is.

By what a flip flop does, at J = 1 and K = 1, the value is flipped between high and low.

Also, i just worked out the answer.

the clock is 60 Hz (non required information).

we have 2 possible answers, if we start at a low, we will end with a low, if we start with a high we will end with a high.

No answers are low ( 0 Hz), so it starts as a high, and finished with a high.

at no point does it say what a high is (at least not in english).

One of the standard is like 0 hz and 5hz i think, so, high = 5 Hz, and low = 0Hz.

possible answers are

0hz (starting as a low)

5Hz (starting as a high)
4  Discussions / General Discussions / Re: FlipFlop - Examn f(CLK) on: 2014-09-15 03:41:08
Longarmx: By the answer, you are still wrong though, as the answer is 5Hz (marked by red).

also there is 4 JK flip flops, so the answer would be 7.5Hz (by your definition).

We never really had a question like this, we answered if the output was high or low, or a timing diagram.
5  Discussions / General Discussions / Re: FlipFlop - Examn f(CLK) on: 2014-09-15 03:32:36
like I said it is badly written.

The output should be what the input theres no answer for 60Hz.

so I assume default high in that circuit is 5 Hz. so a high in the circuit is 5, and a low is 0.

on the outputs of each of the JK flip flops will be

JK (1) = low (toggled from a high to output a low)
JK (2) = high (toggled from a low to output a high)
JK (3) = low (toggled from a high to output a low)
JK (4) = high (toggled from a low to output a high)

as the output just toggles between high and low, because when both J and K are high, it makes a toggle.

by the answer, I am assuming high = 5Hz, and low = 0hz.

JK (1) = 0hz
JK (2) = 5hz
JK (3) = 0hz
JK (4) = 5hz

You shouldn't be sitting an exam you know nothing about. circuits can get complicated very fast, especially when you start using flip flops. But if you know the theory behind it, it is a very easy class (at least at my uni).
6  Discussions / General Discussions / Re: FlipFlop - Examn f(CLK) on: 2014-09-15 03:19:23
JK Flip Flops:

if J and K are both 0, then theres no change.
if J = 0 K = 1, its a reset
if J = 1 K = 0, it is a set
if J = 1 and K = 1, it toggles (light a light switch, if its on, then it becomes off, if its off then it becomes on).


so were using toggle always.

its starts at 60 Hz, then it gets ouputted as 0, it goes in the second JK flip flop, and becomes 5 (very badly written question, it makes you assume you know the voltage that is supplied). the third JK flip flop makes it a 0, and the fourth returns it to be ouputted as 5.

therefor the answer to the question is 5 Hz.

How the answer is 5 Hz, well I cant read your exam, so I cant tell if it says what the voltage supplied to all circuits is, or if you got taught to always use a certain voltage.

EDIT: If I had to answer the question as non multiple choice, I would of probably wrote 60 Hz.
7  Game Development / Newbie & Debugging Questions / Re: Voxel game bad-ish fps on gaming computer and high fps on laptop!?! on: 2014-08-18 10:54:03
bind your block textures before you start your chunk rendering.

once its bound, the texture coordinates you pass in have to be a value between 0 and 1.

coordinate (0, 0), being the top left, and (1, 1) being the bottom right. so you need to find out the coordinates of where each block is on your texture.

chances are you could probably even combine your enemy textures into the same file, even if they are different sizes to your blocks, some extra code for the texture coordinates for mobs (if required), and you could do it all in one texture bind.
8  Game Development / Newbie & Debugging Questions / Re: Voxel game bad-ish fps on gaming computer and high fps on laptop!?! on: 2014-08-18 10:39:04
if you are using immediate mode rendering, then that is your problem, and if you want to make a 3D sandbox game, you should probably look into VBO's.

Though, there's still a small chance you could improve performance.

make sure you only start one draw call ( GL11.glBegin() and GL11.glEnd() ). you want as little as those calls as possible, and have all your textures in a one texture, so you don't have to keep rebinding different textures.

if you have already done that, then either make your world render less blocks, or exactly what you should do, learn a more modern OpenGL approach.
9  Game Development / Newbie & Debugging Questions / Re: Bullet shooting in mouse direction on: 2014-08-10 05:36:58
or if you don't want to use ClickListener, you could do something like

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
   boolean hasReleasedMouse = true;

   public void shoot(){
      if(Input.mousePressed){
         if(hasReleasedMouse){
            hasReleasedMouse = false;
            //shoot
        }
      }else{
         hasReleasedMouse = true;
      }
   }
10  Games Center / WIP games, tools & toy projects / Re: Jumproom on: 2014-07-30 13:41:18
It also does the same thing for the Galaxy S5, screen rotates, and it hangs for like 5 seconds when i open the recent apps to exit out of it, pressing the home button while in the recent apps has another like 5 second hang.
11  Discussions / General Discussions / Re: BrickBroken2 ? SLDT's GameEngine ? on: 2014-07-25 10:44:21
First of all, you shouldn't ask this community if we want you to make BrickBroken2, we are a forum filled with Developers, if you really want to know if there is a community for BrickBroken2, another website would be the best, as the chances are this site wont have a heavy community for your game, especially when to create a account you need to know a little about Java, or you will probably get scared of the activation quiz.

But in my opinion, if you like BrickBroken, and you really want to make the game, create it, post it on here, and improve from the feedback, but ONLY IF YOU WANT TO DEVELOP IT. if you do not want to, move on to your next game idea, if it is something you really want to make, the chances are its going to be a much better game then the game you don't want to develop.

The only time you should develop a game you do not want to make is if you are contracted with someone to develop a game for them (and I would find out about the game they plan before even accepting the contract, as you may not be able to deliver the project they require), and this is definitely not that scenario.

You mentioned you made a Scrabble game with your new engine, why don't you post it to show off what your game engine you made is capable of? Maybe you could extend on your Scrabble Game, and turn it into something more advanced and polished.

If you want someone to use your game engine you create, put it up on github or provide a link for someone to play around with, we do not know if we want to use a game engine that we only know has rendering (what type of rendering? is it OpenGL? Immediate Mode? VBO's? ), input and new features (what are these features?), until we know what exactly it is and how it helps to develop a game and examples of what it can achieve, the answer is probably no.
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-07-24 11:56:51
Tune Locks 2

A sequel to my Ludum Dare game "Tune Locks" for LD26.

EDIT: Link to my Tune Locks LD26 Entry
What the player can see without placing down lights:


When the player places lights down:


It it not all done today, I have been working on it for ages, now and again on and off. For a long time, it turned into my "tech demo" where I was just updating the rendering to VBO's, and trying to get more performance, as well as playing with shaders.

The game started out with just Immediate Mode rendering, then I learnt how to do VBO's more, so I changed the rendering. Then it became my text rendering test. I then decided to learn more about shaders, so I had to learn how to send the VBO data to the shader, and started to learn how to create lights.

By about the time that I learnt all of those, I set the project as "tech demo", planning to never finish the game, but use the current state to just learn new stuff. University started shortly after, and I didn't do much for a while, other then redo my text rendering, it is definitely not great, but idea was, lets just get text working, how ever ugly it looks, then polish it later, not just the code, but the image for the text is definitely not great and some letters are to far over, or to far up.

I then improved on the rendering again, fairly recently (within the last 2 or 3 weeks), I use to cap my lights at 10 or 20, because I would started to get like 300 FPS, down from like 2500 FPS with like 2 lights, and any more it would just go down a lot more. By the time i fixed the rendering, I was getting about 5000 FPS with 2 lights, and 300 FPS with about 126 lights. I can probably increase it a bit better, at the current state, the light is not limited to a certain distance. As well as making the puzzles a lot more easier and cleaner to implement into the game.

What I have done today, and yesterday was removed the limitation of having the level restricted to 32x20 pixels, as well as made the camera follow the player, but not go past the edge of the level, the player will stay in the middle until the camera locks to the side, then the player can gets unlocked until moved in the opposite direction to unlock the camera. I have also decided that I am going to remove it from my "tech demo" and try and finish the game, I have always wanted to, but never got around to it.
13  Game Development / Newbie & Debugging Questions / Re: How to reset the game ? on: 2014-07-19 13:50:12
If you want to reset a game, you don't want to "close the game" and restart it within the application.

To achieve the reset, just reset any variables back to the default.

I am going to assume you have an array of aliens, where you first put the aliens in the array, you could put it into a new method

1  
2  
3  
4  
5  
6  
7  
8  
9  
   public void createLevel(){
      aliens = new Alien[levelSize];
      for(int i = 0; i < levelSize; i++){
         alien[i] = new Alien();
      }
     
      //recreate or have a method inside player to change it back to the default values
     //and anything else you need to create for your game level
  }


something like that, and you can create new levels of any size pretty fast.

Edit: Ninjad, I hate formatting inside the post, so I always open up eclipse to format Sad just as i finished the code you posted it, but it was to much effort to delete!
14  Game Development / Performance Tuning / Re: Efficient Fog of War on: 2014-07-02 13:26:42
I am assuming it is 2D.

First of all, you shouldn't need to search through every tile, you should just check the tiles being rendered on the screen.

you can just recheck the fog of war when an actor moves.

you could only update the fog of war in locations where an actor moves, instead of checking every actor within view every time it updates, you could have only the tiles around the actor to update.

if your using shaders, you could just send an array of vectors, and create lights around the points, with the rest of the tiles being black / darkened.
15  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles >>MAP EDITOR TECH DEMO RELEASED!!<< on: 2014-06-22 06:44:19
Don't think anyone mentioned it:

When hovering over the buttons in the tools on the map editor, you need to position the mouse more towards the center or even pretty much the last pixel of the last button, as the text starts off the edge of the screen.

not sure how you code your text rendering, but you should just check to see if the beginning x is less then 0, if it is put it to like x = 5 or something, so their is a little gap from the edge.
16  Game Development / Game Mechanics / Re: How would I do fading images? on: 2014-06-22 01:37:52
1  
GL11.glColor4f(red, green, blue, alpha);


4f meaning 4 float values.
17  Game Development / Game Mechanics / Re: How would I do fading images? on: 2014-06-22 01:34:19
A super easy way is to just change the alpha value.

To fade the image out, reduce the alpha. To fade it in, increase the alpha.
18  Game Development / Newbie & Debugging Questions / Re: Questions about port speed and game bandwidth required on: 2014-06-19 23:44:01
I am pretty sure most VPS (atleast the ones I have looked at) atleast provide 100/100 Mbit internet.

that "4000" players is theoretical in a perfect scenario, I am sure your ISP tells you you will get a certain amount, but really only get half of it. e.g. in my case I am suppose to get around 20Mbit down, but I only get between 5-7 MBit down. Also, 250Mbit may see like there super advanced, but more and more people are starting to get 1000Mbit internet (I believe the University I go to, their provider also supplies 10gbit internet, rumors that mine have it, but I have only heard people getting around 800 Mbit).

Also for that 4000, you are just taking in account of the network speed required to maintain 4000 players, are you sure your server can handle 4000 players and send 120000 (30 * 4000) packets and update the game at the same time?


TL;DR: You also need to take in account of the hardware required to have 4000 players at one time, which will most likely be the issue.
19  Game Development / Networking & Multiplayer / Re: How safe am I? on: 2014-05-03 08:58:45
go buy the cheapest server you can (http://www.123systems.net/ they have been pretty reliable for me, most likely you only need 1gb or 2b max) that has enough performance for what you need.

IF your game suddenly happens to become huge and your cheap server cant handle it, you can just change to a new company where your getting a better server.

IF your game turns out that you don't get the thousands of players you intended, you lost $50 (most likely $30 max) max for a years worth of server hosting to what you can recover from and try a new game and use the same server to host your game.

This $20-$50 you spent for 1 years worth of hosting saved you in electricity bill, which probably would of cost more if you used a home server based on the fact you had a spare computer. if you had to build a new computer to host the server, well you just saved a few hundred initial cost.
20  Game Development / Newbie & Debugging Questions / Re: glOrthod problem LWJGL on: 2014-04-26 05:22:26
What ever tutorial you are using is horrible.

IF you learn to debug, and start reading java docs, you will relise where you failed.

LWJGL javadoc for glOrtho
21  Game Development / Newbie & Debugging Questions / Re: How to control the game time-line. on: 2014-04-25 08:16:23
true, trollwarriors method would be better if your having a pausing within the game.
22  Game Development / Newbie & Debugging Questions / Re: How to control the game time-line. on: 2014-04-25 07:45:59
I highly doubt you will be having a problem with the CPU not being able to keep up, especially if it is 2D which I am thinking it is.

If you are having a CPU problem,  I think you may be doing something horribly wrong.

To pause the game, in your game loop, have a if statement around your update, and only let the game update if the game is not paused.
23  Game Development / Newbie & Debugging Questions / Re: How to control the game time-line. on: 2014-04-25 07:21:28
somewhere inside your wizards update, work out how to fit it into your code but something like this can detect if 2 seconds has past.

1  
2  
3  
4  
5  
6  
   long oldTime = 0; //set oldTime to when your wizard started the cast
  long timeDelay = 2000; //2000 milliseconds is 2 seconds

   if(System.currentTimeMillis() > oldTime + timeDelay){
      //your wizard has completed your 2 second cast
  }


EDIT: If you want to be more precise, you could use nano time instead of milliseconds, but I don't think you after precise timing, you just want it to work.
24  Discussions / General Discussions / Re: Need C programs to practice for debugging competition on: 2014-04-05 14:27:28

Actually I spotted that bug as soon as I saw the if statements and the first if statement didnt have brackets, when I did a course in University, our tutor kept pretty much nailing it into us to try and not use single line if statements, he said if your working on the project by your self go ahead, but in a group project, someone may have the standard of always using brackets, and could just shove some new code for the if statement in the single line if statement.

so soon as I saw the if statements, I checked and saw the second
goto fail;
immediately.

but knowing I was looking for a bug may of helped me spotting it as soon as I saw it.
25  Game Development / Newbie & Debugging Questions / Re: Web Hosting My Java Server Code - How? on: 2014-04-01 12:02:22
I had a 123system VPS for a year, I found they were pretty good. I had some small issues, but I think most of them was my fault.

The node my VPS was on did go down, and I waited a few days for it to go back up but it didn't, so I contacted them and they said the node my VPS was down and they were trying to fix it and should be a day or 2. after a few days, they offered to transfer people to a new node, but they would lose some stuff from the old VPS, or they could wait it out to how ever long it took to get repaired. I opted for a transfer, as I had nothing important on mine that I couldn't redo in like 20 mins.

123Systems VPS's are cheap, so I would suggest trying one of them, and seeing if you can manage to just use that without many problems.

I would suggest there OpenVZ VPS due to their cheap prices (e.g. 1gb ram is $19, 2gb ram is $30 USD for one year, 4gb ram is $59).

also here is my referral: https://123systems.net/billing/aff.php?aff=1311

not sure to much about their referral benefits.
26  Game Development / Newbie & Debugging Questions / Re: Libgdx how to send arrays to Shader on: 2014-01-22 11:54:21
I am no expert on shaders its just how I learnt to send an array to a shader, and how many lights will you be sending, i think you will need to be sending literally thousands to notice a difference. (notice a difference at sending data to the shader)

remember if your using a fragment shader, its effect every single pixel that you are rendering, chances are you are rendering to many lights at once without restricting the area that the light modifies.
27  Game Development / Newbie & Debugging Questions / Re: Libgdx how to send arrays to Shader on: 2014-01-22 11:49:04
You need to specify the array index in the location, this is pretty much what i use in my shaders

1  
2  
3  
4  
for(int i = 0; i < totalLights; i++){
int loc = shader.getUniformLocation("shaderColor[" + i + "]");
//setuniform here
}
28  Game Development / Newbie & Debugging Questions / Re: GLSL - setting uniform problem on: 2014-01-21 13:48:56
if it is "weird" it is your shader. not my fixed code, i just re arranged your draw call.

how shaders should be used:

1  
2  
3  
4  
5  
shader.begin(); //Begin the shader we want to use

spriteBatcher.draw(...); //put EVERYTHING we want to draw between "begin()" and "end()"

shader.end(); //Our draw call is over, lets stop the shader
29  Game Development / Newbie & Debugging Questions / Re: GLSL - setting uniform problem on: 2014-01-21 13:42:21
You are not using your shader to draw the square.

Fixed code:
1  
2  
3  
4  
5  
map[mapPos].light = Lighting.checkSunLight(mapPosY, mapPosX, this); // It works good.. returns float
Shaders.blockS.begin();
Shaders.blockS.setUniformf("lightBlock", map[mapPos].light); // Problem is here!!!
batch.draw(map[mapPos].getBlockTexture(), (mapPosX * Block.WIDTH), (mapPosY * Block.HEIGHT), Block.WIDTH, Block.HEIGHT); // Doesn't draw the block.
Shaders.blockS.end(); //end the shader as the draw call is over


You should end the shader once you have finished drawing everything with the shader. Basically the shader was useless as you ended your shader before you actually begin drawing with your sprite batcher.
30  Game Development / Newbie & Debugging Questions / Re: NullPointer - TextureRegions on: 2013-12-13 13:33:13
if you re read it, you will know I never said TextureRegion constructor, but the TextureRegion region[][] is null, I showed him how to initialize the array, because either region[][] or playerSheet is null as they are the only variables that can produce a null pointer, like I said in my post that you only read the code snippets of.

To remove your confusion, I will edit the code and use his class name that he had the exception in.
Pages: [1] 2 3 ... 9
 

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 (23 views)
2014-09-12 09:08:26

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

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

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

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

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

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

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

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

mitcheeb (39 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!