Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
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  
  Code 15 - Top Down Shooter  (Read 2610 times)
0 Members and 1 Guest are viewing this topic.
Online Gibbo3771
« Posted 2014-02-26 17:14:10 »

I though I would go ahead and post what I am working on at the moment, currently as it stands it is just mainly working on an engine to work with.

The main reason for working on this project is to practice engine design, file input and output and try to wean myself off the habit of looking for a "do everything" library, if that makes sense.

I am currently using:

LibGDX
Box2D Physics Engine


Pickup Test Level


What is Code15?

Update 13/03/2014 - I have been brainstorming over the past week or so and I think I have a general idea of the story/setting, I am constantly writing down new ideas and putting them all together, here is a little teaser of the opening script for the tutorial/first level that fits in with what I have so far:



"Welcome subject, to the Code 15 Testing Facilities, please follow the instructions carefully so we can complete a medical and motor skills test.

*Controls intro*

Test complete, it seems you have not suffered any brain damage, congratulations you will not be euthanized today.
Let us hope that you will last, it is notoriously difficult to extract new ones from their tube without causing severe damage.

Please follow the path to the next area, please, try not to trip and die.

To be continued....


Cheesy right ^ you can probably guess where it is going.

Currently as it stands, not much! However I can describe what it WILL be so you can picture it. It will be a top down shooter/puzzle game, imagine fast paced levels with lots of things going "boom", plenty of enemies to kill and different weapons to pickup/use.

All complete with Box2D physics, such as grenades exploding into many little bodies and damaging the environment, I aim to create semi-destructible levels, as in the boundary/walls themself will be unbreakable but anything else should be able to get destroyed.

With all this I want to implement fast paced, think on your feet puzzles, disarming bombs, collecting keys in order to progress etc etc.

Over all I have a plan, all wrote down and a design in mind. However I am keeping it SIMPLE as possible at first, I expect to have a playable level within a month (according to my time frame) with basic functionality such as collecting items, enemies etc etc.


What is currently done?

Currently I have focused on mainly coding a level loader (that I was intended to only practice with...) but last night I brain stormed and decided to make a project off it. - Done!

The level loader is simple, I could easily use Tiled but decided not to. At the moment the level loader is capable of loading a level of any size from an image file (each pixel = 1 box2d unit). That sounds boring right? Kind of is, however sort of proud that I actually managed that.

Oh and it also creates and places Star Trek doors at the appropriate locations complete with bad ass sliders and sensors! That I am proud of. Anyway...




What I am working on the now

26/02/2014 - At the moment I am working on the core engine of the game while still trying to give myself visual progression, I have implemented working sliding doors and will most likely leave it as is for now and perhaps start working on player state and control system. So lets go with that, state/player controller.
13/03/2014 - Currently working on creating some levels using what code I have so far, although the level loader is complete I am most likely going to create a class that controls the config loading, as to keep the level loader class tidy. Will also be drawing some other sprites on the side and implementing more guns and items, I also have a bad ass throwable explosive concept planned on paper
21/03/2014 - Properly coding a way to create, spawn and manage entities. Oh and I sort of need to actually create entities, I have no enemies at the moment. I am also working on a path finding demo, that allows you to create your own level of walls and doors and set an entity start point and end point, and watch them work their way across the map Smiley


Controls


  • WASD - Move
  • Arrow Keys - Open respected doors
  • O - Open all doors
  • C - Close all doors

For now I present you with a Door Test Simulation:

OLD
Download - Bitbucket
Download - Dropbox

The code is currently not going to be available until I develop further.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline JVallius
« Reply #1 - Posted 2014-02-26 19:29:04 »

Download is not available without logging in BitBucket.

Online Gibbo3771
« Reply #2 - Posted 2014-02-26 19:51:29 »

Download is not available without logging in BitBucket.

Will provide dropbox link, also implemented some visual graphicsso it's no longer Box2D debug stuff.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online trollwarrior1
« Reply #3 - Posted 2014-02-26 20:01:26 »

I think you need to change your profile photo Cheesy
Online Gibbo3771
« Reply #4 - Posted 2014-02-26 20:08:35 »

I think you need to change your profile photo Cheesy

Yours appears to be missing :p

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline scanevaro
« Reply #5 - Posted 2014-02-26 20:10:51 »

I think you need to change your profile photo Cheesy

yes please haha
Online trollwarrior1
« Reply #6 - Posted 2014-02-26 20:17:11 »


lol not Tongue
Offline VIrtueeL
« Reply #7 - Posted 2014-02-26 21:35:13 »

this is really cool =D

i do devlogs and i do tutorials check em out
https://www.youtube.com/user/InidDevo
Offline matheus23

JGO Kernel


Medals: 106
Projects: 3


You think about my Avatar right now!


« Reply #8 - Posted 2014-02-26 22:32:00 »

Works quite nicely, the doors open just like they should be. It ran perfectly fine on linux.

One thing that didn't work so well was pressing "W" and "D" at the same time. I couldn't be playing a top-down game if that wasn't possible! Cheesy
Another thing is the reactivity. It's okay that the player takes some time to walking, but I think the effect is too slippery.

And I also agree to the profile picture. I don't quite like it either. It's kind of .. uhh... distracting ^^

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline saucymeatman
« Reply #9 - Posted 2014-02-26 22:46:30 »

Here is a little tip for file hosting with dropbox.

If you have a link your giving out, to a folder or file, try
adding a ?dl=1 to the end of the link. It will automatically start downloading
the file(s) and not link the person to the dropbox web pade with the big button
that sais download.

Not that clicking the Download button is much of a hassle, but it is nice having it forcedownload.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline opiop65

JGO Kernel


Medals: 154
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #10 - Posted 2014-02-26 22:53:52 »

I'm pretty sure most links automatically download anyway. I had a game launcher that downloaded files from Dropbox, so it obviously couldn't click Download, but it still worked.

Online Gibbo3771
« Reply #11 - Posted 2014-02-27 08:16:02 »

Works quite nicely, the doors open just like they should be. It ran perfectly fine on linux.

One thing that didn't work so well was pressing "W" and "D" at the same time. I couldn't be playing a top-down game if that wasn't possible! Cheesy
Another thing is the reactivity. It's okay that the player takes some time to walking, but I think the effect is too slippery.

And I also agree to the profile picture. I don't quite like it either. It's kind of .. uhh... distracting ^^

The movement needs tweaking, I just slapped some if statements in there to get it going.

Yeah, he is supposed to sorta speed up to a running pace then slow down quickly, needs fine tuning.

The entire thing is WAAAAYYY off being a game it is a work in progress Cheesy

@all about picture

I had one with a monkey throwing shit at the camera, could be worse...

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline wessles

JGO Wizard


Medals: 66
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #12 - Posted 2014-03-03 01:12:57 »

Here is a tip for smooth movement:

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  
26  
27  
28  
public void update()
{
    // Do input stuffs here
   boolean key_left, key_right, key_up, key_down;

    // Add to velocity
   if(key_left)
        velocity.x += (-1);
    if(key_right)
        velocity.x += (1);
    if(key_up)
        velocity.y += (-1);
    if(key_down)
        velocity.y += (1);

    // Update position
   x += velocity.x;
    y += velocity.y;

    // Dampening the speed
   velocity.scale(.9f);

    // Fine jimmt...
   if(velocity.x < 0.0001)
        velocity.x = 0;
    if(velocity.y < 0.0001)
        velocity.y = 0;
}


Smooth movement guaranteed.  Cool

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #13 - Posted 2014-03-03 01:14:16 »

Here is a tip for smooth movement:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
public void update()
{
    // Add to velocity
   if(key_left)
        velocity.x += (-1);
    if(key_right)
        velocity.x += (1);
    if(key_up)
        velocity.y += (-1);
    if(key_down)
        velocity.y += (1);

    // Update position
   x += velocity.x;
    y += velocity.y;

    // Dampening the speed
   velocity.scale(.9f);
}


Smooth movement guaranteed.  Cool
How does this make any sense, your character just constantly accelerates to inifinity.
Offline opiop65

JGO Kernel


Medals: 154
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #14 - Posted 2014-03-03 01:15:18 »

I think that's the point Tongue

Offline wessles

JGO Wizard


Medals: 66
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #15 - Posted 2014-03-03 01:23:10 »

Isn't that the question, Jimmt?sorta-ish-kinda-relevantgood read tho

You will constantly be going at 90% of the speed of the last frame, so if you just tapped the button, the speed would go from 1, to .9, to .81, until one second has passed and it is only .9^60 = 0.00179701029. And that will just get smaller.

That dampening will get it down to lower than 0.00001. At that point you would not even see the movement.
If you really want, add this:
1  
2  
3  
4  
if(velocity.x < 0.0001)
    velocity.x = 0;
if(velocity.y < 0.0001)
    velocity.y = 0;


wait, did I typo?!

Offline BurntPizza
« Reply #16 - Posted 2014-03-03 01:29:36 »

@wessles, I think Jimmt meant the speed is unbounded if the button is held down.

How 'bout a logistic acceleration curve (note, completely untested, don't know how it would look):

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
public void update() {

    // Add to velocity
   if(key_left)
        velocity.x -= 1;
    if(key_right)
        velocity.x += 1;
    if(key_up)
        velocity.y -= 1;
    if(key_down)
        velocity.y += 1;

    //limit the velocity
   velocity.x = MAX_VELOCITY/(1 + (MAX_VELOCITY - 1) * Math.exp(-ramp * Math.abs(velocity.x)));
    velocity.y = MAX_VELOCITY/(1 + (MAX_VELOCITY - 1) * Math.exp(-ramp * Math.abs(velocity.y)));

    // Update position
   x += velocity.x;
    y += velocity.y;

    // Dampening the speed
   velocity.scale(.9f);
}


edit: fixed some things that didn't make sense
Offline wessles

JGO Wizard


Medals: 66
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #17 - Posted 2014-03-03 01:32:25 »

@wessles, I think Jimmt meant the speed is unbounded if the button is held down.
Well, collision aside, isn't that the case with most games?

Also, yes; curviness is fun as well.

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #18 - Posted 2014-03-03 01:46:09 »

@wessles, I think Jimmt meant the speed is unbounded if the button is held down.
Well, collision aside, isn't that the case with most games?
No, the player may keep moving but it doesn't keep accelerating.
Offline wessles

JGO Wizard


Medals: 66
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #19 - Posted 2014-03-03 01:48:53 »

Whoops! That was deceleration  Tongue.
Actually, acceleration is only the rate at which the velocity changes, never specifying a decrease or increase.

Offline BurntPizza
« Reply #20 - Posted 2014-03-03 01:51:56 »

Realizing my 'logisitic' curve would probably not be the best idea, why not just set the acceleration to a constant on keypress, and then verlet integrate? The acceleration set could be computed from Newton's second law, so 'friction dampening' would be easy.

1  
2  
3  
4  
5  
double accelerationX = (keyPressedForceX - frictionForceX) / mass;
double accelerationY = (keyPressedForceY - frictionForceY) / mass;

positionX = positionX + (positionX - lastX) + accelerationX * delta * delta;
positionY = positionY + (positionY - lastY) + accelerationY * delta * delta;


Of course there are better integration methods to use if so inclined.

edit: added sample code
Offline SwordsMiner

JGO Coder


Medals: 3
Projects: 2
Exp: 1 year


The one and only.


« Reply #21 - Posted 2014-03-03 02:44:19 »

Ooor since hes using box2d wouldst he just have box2d do all the work for him?  Roll Eyes

If I made you laugh, helped you at all, or did something cool, I only ask that you smash that appreciate button with your nose.
Offline wessles

JGO Wizard


Medals: 66
Projects: 4
Exp: 3 years


Profile picture isn't relevant.


« Reply #22 - Posted 2014-03-03 02:49:29 »

That would work; I personally would use a more simple way of moving. Just seems a bit unnecessary to use.

Online Gibbo3771
« Reply #23 - Posted 2014-03-03 04:31:20 »

That would work; I personally would use a more simple way of moving. Just seems a bit unnecessary to use.

I have changed the movement, it now accelerates within a few milliseconds making it look like he goes from a walk to a run very quickly. He also has very light dampening to slow him down.

Not changed enough to warrent an update atm.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Online Gibbo3771
« Reply #24 - Posted 2014-03-13 07:37:57 »

No playable update but have worked on some fun things Smiley.

Implemented level config files, I can now load in pretty much anything from a config file and create it in my world. That is kind of cool.

I have added and tested 3 new items

Keycard:



Pistol: (This will actually be a final item)



Bullet:


Alright so nothing great, however the pistol was a test weapon. It was implemented in a very OO way, any entity will be able to equip it and shoot it.

Couple of gun types can easily be made from the same class:

Shotgun - Configurable bullet count and spread
Assault Rifle - RoF can be changed, single, burst and auto are togglable
Minigun - RoF can be changed, clip size can be altered greatly

All with configurable accuracy/range that is multiplied by whatever value I want, player skill, powerups etc etc.

Here is a screenshot of the new items lying on the ground ready to be picked up and used:



Once I implement a basic AI and some enemies I will upload a test level for you guys to mess about in Cheesy

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline ennix

Junior Member


Medals: 5
Projects: 1



« Reply #25 - Posted 2014-03-13 07:50:25 »

i like the game-name: code15 - cool

be the hexagon
Online Gibbo3771
« Reply #26 - Posted 2014-03-21 20:05:54 »

Seems like a good idea to actually show that I have visual progress. I have been doing a fair bit of work on the path finding AI, although it is ready to go and is capable of guiding whatever I want through the levels, I am here instead to show you some implemented test items!

Grenade

Standard frag grenade, small blast radius, average damage but still enough to kill a man or 5.

Placeholder sprite



<a href="http://www.youtube.com/v/8hmGm5cI2VM?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/8hmGm5cI2VM?version=3&amp;hl=en_US&amp;start=</a>

Pistol

Standard military pistol, low damage but reliable when it comes to killing unarmed things.

<a href="http://www.youtube.com/v/TmXDbFTcAFo?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/TmXDbFTcAFo?version=3&amp;hl=en_US&amp;start=</a>



Coming next

As soon as I code in a proper way to spawn and manage a basic enemy, as well as write all the code for them, I will fire up a pathfinding video and even a demo that allows you to place an enemy, create a maze, set a destination and watch them go!

Dropbox Download

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline Drenius
« Reply #27 - Posted 2014-03-21 20:07:21 »

Private videos.
Online Gibbo3771
« Reply #28 - Posted 2014-03-21 20:08:32 »

Private videos.

Fixed

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Pages: [1]
  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.

TehJavaDev (17 views)
2014-08-28 18:26:30

CopyableCougar4 (26 views)
2014-08-22 19:31:30

atombrot (39 views)
2014-08-19 09:29:53

Tekkerue (36 views)
2014-08-16 06:45:27

Tekkerue (33 views)
2014-08-16 06:22:17

Tekkerue (22 views)
2014-08-16 06:20:21

Tekkerue (33 views)
2014-08-16 06:12:11

Rayexar (67 views)
2014-08-11 02:49:23

BurntPizza (45 views)
2014-08-09 21:09:32

BurntPizza (36 views)
2014-08-08 02:01:56
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!