
-----------------------------------
gafiga
Thu Jun 19, 2008 5:31 pm

How to make a 2d game.
-----------------------------------
Hey, i had some extra time and thought i would make a game Tutorial.
this tutorial is for people who know the basic Turing commands.
it includes:
-basic movement
-health bars
-warp pads
-HP boxes

this is my first tutorial so if theres anything i could work more on just let me know.

-----------------------------------
andrew.
Mon Jul 21, 2008 7:31 pm

RE:How to make a 2d game.
-----------------------------------
Did you get this checked out by Tony or one of those guys? I think you have to do that with any tutorial.

Also, if you are making a tutorial, you should make one that doesn't use whatdotcolour. That is a crappy and inefficient way of collision detection. You may also want to add barriers because my guy walked out the screen and I couldn't come back. Also, I know this is for beginners only, but I think you should show how to read and write from a file so that you can create as many maps as you want. So, each map will have a text file that goes with it describing platforms, danger areas, jumpads, etc.

It's pretty decent though. Just make sure you change the whatdotcolour and get it checked out by one of the mods.

-----------------------------------
Tony
Mon Jul 21, 2008 7:41 pm

RE:How to make a 2d game.
-----------------------------------
The explicit moderator involvement is only required to have something included into the Turing Walkthough. At least for now.

-----------------------------------
andrew.
Tue Jul 22, 2008 5:36 pm

RE:How to make a 2d game.
-----------------------------------
Oh, I thought you had to get everything checked out before posting here.

-----------------------------------
amaranth18
Tue Jan 12, 2010 9:13 am

RE:How to make a 2d game.
-----------------------------------
Hey I just read your tutorial and i found it extremely helpful. I was wondering though, if there was any way to get enemies and to make the screen bigger? I want to make a mario typed game based off your code (which i will cite), but I need to add enemies and maybe make it a larger screen. If you can help then it would be much appreciated.

Cheers,

Amaranth18

-----------------------------------
0isin
Wed Jan 13, 2010 2:25 pm

Re: RE:How to make a 2d game.
-----------------------------------
Hey I just read your tutorial and i found it extremely helpful. I was wondering though, if there was any way to get enemies and to make the screen bigger? I want to make a mario typed game based off your code (which i will cite), but I need to add enemies and maybe make it a larger screen. If you can help then it would be much appreciated.

Cheers,

Amaranth18

To make the screen, near the top, you should put this into turing.

setscreen ("graphics:800;600,nobuttonbar")

this is to "set" the screen. 800 is how many pixels wide, and 600 is how many high. The no button bar line is so that the "save, new, whatever" button bar isn't there.

Hope this helped.

-----------------------------------
feebas200
Sat Apr 09, 2011 2:23 pm

RE:How to make a 2d game.
-----------------------------------
Nice tut, what's the other way for collision detection? What if I wanted to make a maze? What should I use for collision of all walls? Thanks in advance.

-----------------------------------
apython1992
Sat Apr 09, 2011 2:33 pm

RE:How to make a 2d game.
-----------------------------------
I think tile-based collision detection would be the best way for something like a maze. It could be as simple as having your grid mapped out as such:

1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 0 0 0 1 1 1 1 1
1 1 1 1 0 1 0 1 1 1 1 1
1 1 1 1 0 1 0 1 1 1 1 1
1 1 1 1 0 1 0 1 1 1 1 1 
1 1 1 1 0 1 0 1 1 1 1 1
0 0 0 0 0 1 1 1 1 1 1 1
1 1 1 1 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1

Where a 1 is a barrier/wall. Now that is the crappiest maze ever, but for the purpose of illustration I think that would be your way to go.

-----------------------------------
feebas200
Sat Apr 09, 2011 3:27 pm

RE:How to make a 2d game.
-----------------------------------
is there a tutorial for it? I'm not that experienced yet.

-----------------------------------
apython1992
Sat Apr 09, 2011 4:16 pm

RE:How to make a 2d game.
-----------------------------------
http://compsci.ca/v3/viewtopic.php?t=15927

-----------------------------------
feebas200
Sat Apr 09, 2011 4:55 pm

RE:How to make a 2d game.
-----------------------------------
thanks, but isn't it difficult to draw a difficult maze with 1 and 0's manually. It seemed kind of easier by using an image of a maze and dotclour.

-----------------------------------
apython1992
Sat Apr 09, 2011 10:54 pm

RE:How to make a 2d game.
-----------------------------------
If you plan on using an already-made maze, you could use colours initially to store the map in a format better suited to collision detection, like the one I showed you before.

Pseudocode:
[code]
if pixel.color == {whatever colour acts as the boundary} then
    gridNode = 1
else
   gridNode = 0
[/code]
