Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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  
  WIP 2d adventure game  (Read 2607 times)
0 Members and 1 Guest are viewing this topic.
Offline ricardo

Senior Member


Medals: 2
Projects: 3



« Posted 2013-11-01 23:30:33 »

https://lh4.googleusercontent.com/-bSfiJZgMKRw/UnFoH1QXYuI/AAAAAAAAAPQ/EbYCi5ILRYQ/s480/a.gif
(gif is slow. my game runs smooth)
resources used on image from opengameart, just to check if everything works. I will replace them. List here:
bat: Charles Sanchez
campfire: Jetrel and Zabin
player: edzet from deviantart (I think)
grass, water, tree: Lanea Zimmerman

I'm trying to create a 2d adventure game. This is not a rpg. I will not implement fight system. Instead, I will create puzzles and side-quests.
This is some kind of "tool / engine / template". Still need many work.

Done:
-game states
-game loop
-load sprites
-load tilesets
-load maps
-layers
-animated tiles
-animated sprites
-movement
-collision
-keyboard input
-scroll map

Work on:
-automatic move sprites to xy

To Do:
-dynamic collision (all objects that can move like sprites)
-automatic move sprites to xy
-menu
-inventory (maybe)
-map editor
-events
-gui
-change resolution and handle full screen
-~
-clean and optimize code
Online Drenius
« Reply #1 - Posted 2013-11-02 00:30:20 »

Looks good so far.
What kind of puzzle will it be?
Offline ricardo

Senior Member


Medals: 2
Projects: 3



« Reply #2 - Posted 2013-11-02 01:16:03 »

I exactly don't know the main theme yet.
I want something fun for all ages but with good puzzles to solve and some "boss" puzzles.
Puzzles must be related with the game theme.
I have something that I want to do, but I don't know yet if I will do it at this point.
So I can't tell how my puzzles will be.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline lcass
« Reply #3 - Posted 2013-11-02 09:01:59 »

I exactly don't know the main theme yet.
I want something fun for all ages but with good puzzles to solve and some "boss" puzzles.
Puzzles must be related with the game theme.
I have something that I want to do, but I don't know yet if I will do it at this point.
So I can't tell how my puzzles will be.
Would it be a zelda kind of theme or maybe a magical concoction of coder puns Smiley
Offline gongalf
« Reply #4 - Posted 2013-11-03 20:40:31 »

Do you have any idea about the plot? And about the puzzles, you could include some enemies (although there's not a fight system) as part of them.

Offline ricardo

Senior Member


Medals: 2
Projects: 3



« Reply #5 - Posted 2013-11-03 21:07:15 »

I will focus first on finishing this "template" of code.
When everything works (gui, scroll maps, load / save system, path finding for AI, ...) I will work on a decent background history, but I have 2 plots that I want to see in a game.
This is not an engine though, I just want to make a template so I can re-use to create something new.

Plots i'm thinking:
-Fantasy: Unexpected history line with some clever jokes in the background. The player find an old fantasy book. The game consists of the stories written in the book.
-Comic: A shepherd falls asleep and one of his sheep get away. He need to find that sheep. This one seems kinda bad, I still need to work on.

I'm not thinking on a serious and mature story line now. Just need to code everything.
Also, I need something simple to re-write for android. I will have my first game released on play store this month I hope.
Offline saucymeatman
« Reply #6 - Posted 2013-11-04 01:31:52 »

Looks sweet man, if you can post a playable demo on here. Grin
Will it be open source or closed source?
Your welcome to take code from TheEntropyGameEngine, to
help build your collision system. But it might not be right for your game.
https://github.com/Saucymeatman/EntropyGameEngine
If you take from it, give me a star or +1  Wink

Anyway, happy coding
Offline ricardo

Senior Member


Medals: 2
Projects: 3



« Reply #7 - Posted 2013-11-04 02:07:27 »

I guess I can post the code with some kind of tutorial when I finish.
Thank you, but I like to program and know all my code. Also, I don't know if my game works well with your engine (without to many changes).

I will be happy to release a demo, but this will take at least 1 month to be stable. I'm rewriting some code.
Offline ricardo

Senior Member


Medals: 2
Projects: 3



« Reply #8 - Posted 2013-11-06 01:15:23 »

I need some tips here.
With is better, move sprites on a grid or free?

pros (in my opinion):
-player will never be "stuck" if he want to enter some house, because game will center player with door and don't touch walls.
-easy to implement npc movement. Something like: moveTo[4,10];.
-nostalgic gameplay. If i'm not wrong, old 2d rpg games use grid system, like Final Fantasy.
-easy to implement and also easy to interact map with objects and collisions.

cons (in my opinion):
-maybe will not suite for all player be stuck on a grid and can't move freely.
-collisions must be made with grid too and if I have something small inside a tile that I need to block, player will have awkward free space that can't walk.
-map limitations. I need to draw almost everything on a grid to avoid awkward collision borders.
-player need to wait for movement to complete (reach next tile) before change direction (for example go up and go left).

I don't know. With my code now, player can move freely but I want to move sprites to x_tile and y_tile because is easy to manage game events. (example: if playerPos==[10,10] moveBat[9,10])
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #9 - Posted 2013-11-06 02:16:09 »

Move them freely. I like being able to explore my environment, and being restricted to a grid doesn't promote exploration!

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

Senior Member


Medals: 2
Projects: 3



« Reply #10 - Posted 2013-11-06 03:53:51 »

Thank you. Tomorrow I will check it out.
But you are right.
I'm still thinking in a way to implement grid position and normal x and y.
Useful to move sprites to x_tile, y_tile, check events etc.

Maybe I will just do something like this: tile_x = x / frame_size_x.
The problem is if I'm 1px left this will trigger my left_tile and I'm on the right_tile.
Maybe if I use double variable I could check what size player is more closed to:
2,4 = tile_x = 2
2,6 = tile_x = 3

I need to check this tomorrow, if someone have suggestions are welcome Cheesy
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #11 - Posted 2013-11-06 03:57:26 »

Use something called AABBs. It stands for Axis Aligned Bounding Boxes, and it basically is a box that surrounds the entity and can collide with other boxes as long as they are aligned to an axis (meaning it hasn't been rotated).

Take a look at this tutorial from our own forum!:
http://www.java-gaming.org/index.php?topic=27326.0

Offline ricardo

Senior Member


Medals: 2
Projects: 3



« Reply #12 - Posted 2013-11-06 04:02:01 »

But I already have my collision done.
I want to move enemies and npc without calculate real coordinates, but instead use tiles. Move to x,y tile.
And check what tile my player is too.

I guess I could check collision for every tile to see if I'm in, but this is not the best way to do it.
I'm over thinking this one. And it is simple.

Tomorrow I will check this out with a fresh brain. Grin
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #13 - Posted 2013-11-06 04:04:32 »

Nah, you need to check the collision for the entity, or else you really can't have movement off the grid. If you are doing it tile by tile, that would work, but since entities can be on two or more tiles at the same time, you need a way to check the actual entity's coordinates and base collision off of that.

Trust me.

Offline ricardo

Senior Member


Medals: 2
Projects: 3



« Reply #14 - Posted 2013-11-06 16:47:14 »

Ok, I changed my Collision method.
I check real collision coordinates and also I check sprite layer. If layer > collision just overlay and don't stop (for flying sprites, etc).

Also, I will implement setTo(x_tile, y_tile).
It is easy... I just need to multiply x_tile * frameSize[0] and y_tile * frameSize[1].

Yesterday I was over thinking.

More updates soon, and maybe a demo just with movement and collision detection.


Update:
Scroll map done. Everything works smooth and only tiles on screen are drawn.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

CogWheelz (9 views)
2014-07-30 21:08:39

Riven (20 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

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

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

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

Riven (30 views)
2014-07-23 20:56:16
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!