1 – Java 2D Game Tutorial/Help (part 1) – Side-scrolling game

Java

Video is ready, Click Here to View ×


(This is part 1 of 2) This tutorial will teach you how to make a Java side scroller 2D game such as Super Mario.

Points to note:

A) You can loop the background so that your character stays in one spot and the background moves (like how it is in old Mario games)

B) You can use different images for your “main character” such as one of him walking left, crouching, etc. so that when you press left it seems as if the character actually turns left

C) You can add jumping capabilities by using…

39 thoughts on “1 – Java 2D Game Tutorial/Help (part 1) – Side-scrolling game

  1. Hello,,

    Thanks for taking the time to make these tutorials.

    If you don't mind a few suggestions, I think it will really help your code/presentation.

    1-Explain a bit more about certain things. For example, what is a frame? What does "public static void" mean, especially in terms of package encapsulation. What is a constructor. Remember, this is a tutorial….

    2-Use more meaningful variable names. nx, nx2, x, etc.. are meaningless.

    Then, I have a question….
    Are there any events that could be used instead of the position detection during draw….for example, can't you override the set x method and inspect the value there? I ask because the draw method is getting so busy. I simply do not know if that would work or not.

    Anyway, thanks again and great job.

    Regards,
    ME

  2. With a bit of time and effort and some better graphics, this could be made into something really good! And for all those asking for the source code, the whole point is that you do it yourself. If you need source code, learn programming again, as you shouldn't need it for this – AT ALL.

  3. Guys for body who is still stuck with the Timer problem getting errors, I too had the issue but have worked out a fix, especially for eclipse, but I'm sure it will work in others. First make sure import java.awt.Timer; is not imported, as whilst first using timer, mine was automatically imported, once u delete it from ur imports list, only then import this. import javax.swing.Timer; and then you shall see ur errors disolve:) Thumbs up so people can see if you like 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *