Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (780)
Games in Android Showcase (233)
games submitted by our members
Games in WIP (856)
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  
  language for platform games  (Read 7318 times)
0 Members and 1 Guest are viewing this topic.
Offline mike_bike_kite
« Posted 2012-04-01 19:05:39 »

My son wanted to produce a game but full on games are a little tough to produce when you're young. I wondered about creating a small language to create platform games - platforms, ladders, elevators etc. The idea would be to allow people to create their own platform but the different games could all plug together. I figured perhaps there could be simple blocks you could push around and perhaps have zombie figures chasing after you (if desired).

The language looks a bit like this at the moment:

# simple set of 5 platforms with a ladder between each
define x   40
loop 5
    define y   loop * 40
    platform at x, y extend right 100
    ladder at x+rnd(100), y extend up 40

I haven't written it yet but I quite like designing small languages (and interpreters etc) so that part is quite easy for me. Without going into much detail of the language, does it look understandable? for a school kids etc? Has it been done before? There is a little bit more to the language that makes it extendible etc and I'd be happy to explain and get feedback on that part if anyone's interested.

Arcade swarm
Board Chess - Checkers - Othello
Offline sproingie

JGO Kernel

Medals: 202

« Reply #1 - Posted 2012-04-01 20:30:50 »

Are there any particular advantages of this language over, say, python?  Using something like LangScape you can even extend python's syntax with new constructs.
Offline Archibald

Junior Devvie

Projects: 1

« Reply #2 - Posted 2012-04-01 20:34:09 »

I was coding in a young age and that could would be absolutely and completely enigma to me back then. Actually... even now I can't understand the code you posted without thinking about it hard Cheesy

Generally, once you understand loops and variables you don't need any "special" language, you can as well use existing ones. The problem for a kid, unless I was a weirdo when I was young, is not the syntax but the overall concept.

Not to mention that you might simply need math knowledge to make games (like jumping in a platformer is a cosinus). A kid might not know what cosinus/sinus is, and even if he knows I highly doubt the kid would want to do the things he does in school (calculating lame cosinuses) in his hobby time (on the other hand it might be a nice trick to teach the kid the importance of education in a real life Cheesy).
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven

« JGO Overlord »

Medals: 1357
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #3 - Posted 2012-04-01 20:37:24 »

(I don't see why you need a cosinus to jump. You jump in the shape of a parabole, not some wave...)

I agree that that language you came up with is pretty much unreadable to me. Not that I can't see the intent, but it lacks obvious structure.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline ReBirth
« Reply #4 - Posted 2012-04-02 00:35:53 »

How old your son?

Offline mike_bike_kite
« Reply #5 - Posted 2012-04-02 12:59:30 »

Thanks for the feedback. My younger son's 12 but quite bright. The aim of the language was to just define where the platforms are etc and no more work would be required ie jumping etc would be handled by my part. The advantage of this little language is that you could create your own playable platform game in just a couple of lines of code as opposed to writing 100's or 1000's of lines of code ie the code snippet below is one whole platform game. The other advantage is that these levels could plug together.

This is a better description of what the previous program does:
# simple set of 5 platforms with a ladder between each
define x   40                            # sets x to 40
loop 5                                     # loops round 5 times
    define y   loop * 40               # y gets set to 1*40 then 2*40 etc
    platform at x, y                     # draws a platform at x,y coord
    ladder at x+rnd(100), y           # draws connecting ladders

The above would be enough to start playing a game. It looks intuitive to me obviously because I came up with the language but it was interesting to hear I need to make it easier. The advantage of my small design is that I can create types of things (like platforms) and then plonk them on the screen to use. This is how I would define the platform and I'd do it elsewhere so the user doesn't have to write the standard stuff:

define platform                          # this defines what a platform is
      image "plat.png"                  # there's an image
      extend right 100                  # that gets repeated for 100 pixels going right
      action stand                       # the player can stand on this item

Other options apart from stand are :
  • stand         # player can stand on this
  • climb         # for ladders or trees I guess
  • die            # any contact will kill player
  • ignore        # just part of background image
  • push          # the player can push this item around

You can define various things for any item, so above we have the platform extending to the right for 100 pixels but, if that wasn't what you wanted, you could just add a different extend when placing a platform ie:
platform at x, y extend up 200

Other options allow items to move so you could just define an elevator to go from the bottom of the screen to the top as follows:
define elevator                        # this defines what an elevator is
       image "plat.png"               # just used same picture but could be anything
       action stand                    # must be able to stand on it
       move up 400 restart          # it will move up the screen 400 pixels and then restart

then I could place elevators anywhere on screen:
elevator at 50,0
elevator at 400,40

Does that make it clearer?

Arcade swarm
Board Chess - Checkers - Othello
Offline 65K
« Reply #6 - Posted 2012-04-02 14:03:10 »

Most important question is, is that what your son wants or is it you having fun in designing this stuff ?
Has he used the right tools so far, are his goals neither too low nor too high set ?
What you describe sounds rather like a complete configurable game than a little language.

Lethal Running - a RPG about a deadly game show held in a futuristic dystopian society.
Offline mike_bike_kite
« Reply #7 - Posted 2012-04-02 15:28:43 »

I suppose my son is the impetus but I like to have interesting projects. I'm just coming to the end of writing a chess program at the moment! I'm pretty sure my son would use it, at least for a few games, especially if he could give a link to his friends so they could play. An interesting side effect might be to interest him in programming - if it only takes a few lines to create a game and you can immediately see the effect on screen then that makes it more interesting than writing a similar amount of code to say "hello world"! Lastly I like creating new languages but I'll admit I sometimes get carried away doing stuff that no one would ever use Undecided

My son has just created a game using powerpoint (bizarre but that's what he did) and I'd like to make it easy for him to create games of his own design. I think it's good exercise for the mind. I think if I could appeal to school kids, teach them a little about coding and perhaps amuse my son for 20 minutes then it might be worth it. If it does work well then there's quite a lot of room for expansion of the idea.

Arcade swarm
Board Chess - Checkers - Othello
Offline CaptainJester

JGO Knight

Medals: 12
Projects: 2
Exp: 14 years

Make it work; make it better.

« Reply #8 - Posted 2012-04-02 22:26:40 »

I believe that is what Sratch was made for.

Offline mike_bike_kite
« Reply #9 - Posted 2012-04-02 23:27:09 »

I believe that is what Sratch was made for.
I hadn't heard of it so I just had a look at it. It certainly looks like it might make game programming slightly easier but it's still very procedural ie you have to code each movement etc etc. Have you used it? and if so what did you produce? and how long was the resultant code? did it take long to write? I'm hoping to allow kids to produce games they'd be pleased to play (and write) in under a dozen lines of code. Not sure whether I'll achieve that but hey ho.

Arcade swarm
Board Chess - Checkers - Othello
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline CaptainJester

JGO Knight

Medals: 12
Projects: 2
Exp: 14 years

Make it work; make it better.

« Reply #10 - Posted 2012-04-04 03:01:03 »

I never tried. I just remembered reading a quick blurb on it.

Pages: [1]
  ignore  |  Print  

hadezbladez (730 views)
2018-11-16 13:46:03

hadezbladez (369 views)
2018-11-16 13:41:33

hadezbladez (720 views)
2018-11-16 13:35:35

hadezbladez (184 views)
2018-11-16 13:32:03

EgonOlsen (2379 views)
2018-06-10 19:43:48

EgonOlsen (2533 views)
2018-06-10 19:43:44

EgonOlsen (1470 views)
2018-06-10 19:43:20

DesertCoockie (2135 views)
2018-05-13 18:23:11

nelsongames (1931 views)
2018-04-24 18:15:36

nelsongames (2614 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 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‑
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!