Make game with 2 windows! *Demo updated!*

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

Make game with 2 windows! *Demo updated!*

Postby lcl » Thu Jul 28, 2011 1:47 pm

Hello,
here is little example of how to make a game
which will run in two windows at the same time.

It can be used to make a two player game.
Both actors have to be controlled by the same window because the other windows
key down events don't work when other one is active. But you can make other one follow other player
and another one will follow another one.

The basic idea is that game window 1 writes characters state (position, animindex, animpos) into file and the game window 2 reads them from there. It actually seems to work fast enough for make games with that system.
So, the character is actually running by the key down event just in window 1 but window2 reads that info from file and makes the character also move.

Sorry if this made no sense, it's hard to explan this. :P

That's how it works:


AND SORRY FOR EXTREMELY BAD GRAPHICS! xD
2screens.jpg


Download: (UPDATED!)
http://www.mediafire.com/download.php?i7n5ib1o3kh2xt9

Please post if you have any questions or feedback. :)

lcl

ps. what's wrong with the forum uploadings?
I can't use the java uploader, it just doesn't add the file and the normal uploader says that file size limit is 100 KiB though it should be 2 MB!
Last edited by lcl on Thu Jul 28, 2011 4:39 pm, edited 4 times in total.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Make game with 2 windows!

Postby Game A Gogo » Thu Jul 28, 2011 3:49 pm

This gave me a brilliant idea.... if you don't mind I will upload here when it's done!
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Make game with 2 windows!

Postby lcl » Thu Jul 28, 2011 4:14 pm

Game A Gogo wrote:This gave me a brilliant idea.... if you don't mind I will upload here when it's done!

Yeah, just go ahead! :D
I have also done now a better demo of this, I'll send it soon! :D
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Make game with 2 windows! *Demo updated!*

Postby Game A Gogo » Thu Jul 28, 2011 5:46 pm

Ha I love the end of the video xD

also here's what I made :)

http://dl.dropbox.com/u/9246426/multi%2 ... xemple.zip

the script is FULLY commented, make sure to check out the global codes!

With this, you could make GUI separated from the game, showing you information like maps and status!
Also with editors... you could have many windows for multiple projects and others for tools and what not...

Makslane needs to allow opening other ge-games in new window ):
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Make game with 2 windows! *Demo updated!*

Postby lcl » Thu Jul 28, 2011 6:23 pm

Game A Gogo wrote:Ha I love the end of the video xD

xD
Game A Gogo wrote:Makslane needs to allow opening other ge-games in new window ):

Yeah! exactly! :)

EDIT:
Wow, nice work! :)
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Make game with 2 windows! *Demo updated!*

Postby lcl » Thu Jul 28, 2011 6:35 pm

I think I'll try to make a 2D worms like game with that 2 windows system in my demo :D
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Make game with 2 windows! *Demo updated!*

Postby Camper1995 » Sat Jul 30, 2011 10:51 pm

Wow nice. You guys rock.

Oh and GAG, can I use your player sprite sheet as a template for mine? I need some template with leg movement and your is perfect for what I need :)

+1 to both of you ;3
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Make game with 2 windows! *Demo updated!*

Postby Game A Gogo » Sun Jul 31, 2011 12:25 am

Sure, but credit would be appreciated :)
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Make game with 2 windows! *Demo updated!*

Postby Camper1995 » Sun Jul 31, 2011 10:45 am

Of course GAG :wink:
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Make game with 2 windows! *Demo updated!*

Postby JamesLeonardo32 » Mon Oct 03, 2011 5:57 pm

Wow. Someday I'll learn how to do such style of advanced coding.

Very well done.
JamesLeonardo32
 
Posts: 320
Joined: Wed Oct 13, 2010 4:57 pm
Score: 36 Give a positive score

Re: Make game with 2 windows! *Demo updated!*

Postby lcl » Mon Oct 03, 2011 7:30 pm

JamesLeonardo32 wrote:Wow. Someday I'll learn how to do such style of advanced coding.

Very well done.

Thanks! :)
And well the learning comes by itself if you're interested to challenge yourself to try to make something which goes to the limits of your coding skills. That's how I've learnt, by trying to do some things I've thought would be nice to be able to do. Of course it requires time and patience, and I know I'm just starting to learn, there is so much to learn still, and that's what keeps one interested, to always have something you want to learn! :)
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Make game with 2 windows! *Demo updated!*

Postby tintran » Mon Oct 03, 2011 8:00 pm

brilliant. if we can map a file across the network. we can have multiplayer games. +1
User avatar
tintran
 
Posts: 157
Joined: Fri Dec 24, 2010 1:34 am
Score: 30 Give a positive score

Re: Make game with 2 windows! *Demo updated!*

Postby Fojam » Mon Oct 03, 2011 11:37 pm

so does this work by constantly loading saved variables from the other game over and over again? thats pretty interesting i never would have though of that.
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score


Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest