Slick Forums

Discuss the Slick 2D Library
It is currently Mon May 20, 2013 5:33 am

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Fri Aug 26, 2011 1:59 pm 
Offline
User avatar

Joined: Thu Aug 25, 2011 8:45 pm
Posts: 27
Location: USA
all games:
http://www.onewordtale.com/othergames.html

http://www.onewordtale.com/games/RealKnight/realknight.html

I just finished a very simple target shooting game (don't ask about the name haha... I had a different idea in mind when I started, but this is what it has become).

You're a knight with a gun (for some reason.. pretty sweet huh), on a field and targets will pop up for you to shoot at (only 1 bullet on screen at once right now). It's a single screen game where I found a free tilemap sheet online and used Tiled to create the map. I used paint to make the spritesheet and targets/bullets from scratch (so they could use a little work). Well, give it a go, won't hurt, below are the controls and UI, the same as on my website.

Controls:

W,A,S,D to move
Left Shift to sprint
R to reload manually, automatically reloads after 5 shots
T to start game (targets appear, time limit starts, scoring starts, stamina goes down)
ENTER/RETURN will shoot in the direction the character is facing (going to the top left is considered left facing, top right is considered right facing, bottom left is left facing and bottom right is right facing)

UI:

In the top left is the timer, it will count down from 60 seconds when the game is started (T). In the Top right is your score, how many targets you have hit. On the bottom right is your stamina bar, it will deplete as you sprint (Left Shift), and only begin depleting when the game has been started (T). On the bottom left is the ammo in the clip, currently 5 rounds, reload with (R) or after the 5 shots are gone automatically.


TODO (things to fix that I'm aware of):
-DONE, SHOULD NOW BE OKAY; better hit detection on the targets
-DONE, NOW 5 ALLOWED, RELOADING WILL OCCUR AFTER 5 SHOTS; allow more than 1 bullet on screen at once (via bullet array)
-DONE, 5 ROUND CLIP AND 2 SECOND RELOAD AFTER SHOTS ARE GONE OR BY PRESSING 'R'; perhaps implement reloading
-DONE; scale gfx to be larger, its to small atm
-make 'shoot' start the game

Also, thanks for the help on making the jar executable guys!

ED---
There also isn't any sound.. so oops.. that is a big thing that can and should be updated.. will do!

I fixed "R" not working for reload, and made ENTER/RETURN shoot; it makes more sense


Last edited by Fonix on Fri Sep 02, 2011 6:11 pm, edited 8 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 26, 2011 2:52 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1313
Location: Italy
good first game, keep working :D

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2011 7:13 am 
Offline
Regular
User avatar

Joined: Wed Apr 27, 2011 3:29 pm
Posts: 194
Location: United State of California
I'd suggest setting the control for shooting to something other than the mouse button. If the mouse does not control the aim of the bullet, it can be confusing for a new player.

The game is too small for me. You don't have to make larger graphics, you can just scale the game to 50% larger or something. It'll be easier on the eyes and have a retro, artistic feeling to it.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2011 12:40 pm 
Offline
User avatar

Joined: Thu Aug 25, 2011 8:45 pm
Posts: 27
Location: USA
Good idea. I like the whole retro theme. I'll give that a go next time I work on it.

And maybe I'll assign shoot to the up arrow key or something.

Thank you for trying it and giving me feedback.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2011 3:48 pm 
Offline
User avatar

Joined: Thu Aug 25, 2011 8:45 pm
Posts: 27
Location: USA
Well, I've scaled the gfx to 1.5 their size, should make the game more easy to see!

With that of course (maybe not of course) comes a few hit detection issues, I'll adjust that next, shouldn't take long.

Also, made ENTER shoot, next will be start the game by shooting.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2011 5:02 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1313
Location: Italy
it's time to make an applet of it.

an maybe add some speed on main char?

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2011 6:48 pm 
Offline
Regular
User avatar

Joined: Wed Apr 27, 2011 3:29 pm
Posts: 194
Location: United State of California
I'll second making an applet. It's my preferred form of distribution at the moment.

Also noticed the player doesn't seem to walk at a constant speed. If this was unintentional, make sure all your movements are multiplied by the delta.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2011 2:01 pm 
Offline
User avatar

Joined: Thu Aug 25, 2011 8:45 pm
Posts: 27
Location: USA
So, if you may have seen, I've applet-tized it, on that same page on the bottom. I know how I can optimize the load time by reducing some image sizes, I'll get on that but I also have another question..

About the using delta to move, which I haven't been doing (i know.. big nono!). I draw the bullets/player movement in their respective classes, and I call the move functions from the main classes render function. This means I don't have access to the update function's delta parameter (or do I?); should I move around where I do things or is there a way to access it in render and pass it to the function calls.

I understand it should be used in update to change variables and that's not something to do in the render method, and even calling other functions and doing it in them is the same thing kind of. It would be easier if I could just pass it, maybe make a global variable and always set it to delta then when it gets to render it'll be that value? Actually, I'm going to try that now...

---
That seems to do it, next time I'll be more careful and be sure to do it right.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2011 3:15 pm 
Offline
Regular
User avatar

Joined: Wed Apr 27, 2011 3:29 pm
Posts: 194
Location: United State of California
Don't make the delta global. The reason it's not globally accessible already is to help stop you from doing such operations in the render method. It might not seem like such a big deal now with the computer you're testing on but there is potential for someone to have a really poor experience with your game down the line.
Moving your controls and physics to the update method shouldn't be too difficult. Just pass the delta value down to your class methods like you said. Make different methods for controls, physics, and rendering.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2011 3:19 pm 
Offline
User avatar

Joined: Thu Aug 25, 2011 8:45 pm
Posts: 27
Location: USA
Okay, you're correct, if I want to do things right I just have to do them. I'll take the time to set the position variables in update via methods, while passing the delta to them, then call the draw methods in render.

--
WOW! that actually fixed a problem I was having with different move speeds at different FPS! I know I've read about delta etc. but this is the first time I did it right, awesome, now I won't forget that again. Even when I tried it global, it wasn't doing it right, so theres no skimping out on delta! use it!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2011 5:10 pm 
Offline
Regular
User avatar

Joined: Wed Apr 27, 2011 3:29 pm
Posts: 194
Location: United State of California
:D


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 02, 2011 6:08 pm 
Offline
User avatar

Joined: Thu Aug 25, 2011 8:45 pm
Posts: 27
Location: USA
Well, I've completed work on my second tiny game, Cave In. It was a lot easier to create a game after learning some important things the first time, and took only a few days to get where it is. Making the gfx are always the hardest =P.

http://www.onewordtale.com/games/CaveIn/cavein.html

It's one of those "avoid falling objects" games. I think I'm done making such simple games and my next project might be a bit more ambitious, that or I may make another simple one and actually implement sound/a menu system.

Sorry for the no sound but I do some dev at work during down time and I can't be making things here. As said previously, I'll implement it down the road.

One concern I have, this game seems to have bad performance in Applet mode for me.. don't know if its for everyone or what, but the jar seems to run better.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 03, 2011 7:35 am 
Offline
Regular
User avatar

Joined: Wed Apr 27, 2011 3:29 pm
Posts: 194
Location: United State of California
You ought to make a separate thread for the new game. Fun concept however the game stuttered a lot for some reason.

A nice visual effect would be to quickly fade in the stalactites. Appearing out of nowhere is too abrupt.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 03, 2011 12:38 pm 
Offline
User avatar

Joined: Thu Aug 25, 2011 8:45 pm
Posts: 27
Location: USA
Yea I wasn't sure if it was worthy to post a new thread haha. I'll do that.

The logical reason for why it stutters is the for loops for the array of 10 stalagtites.. But I don't get why it only happens in the applet.. Unless you were suggesting it also happened in thrust as well.

Good idea, I'll either have them slowly creep in from the top even higher, or learn to use transparency, probably should.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group