ForumsProgramming ForumSome helpful tips. ** Programmers please post**

16 6214
SwordAndShield
offline
SwordAndShield
567 posts
Nomad

I was hoping some really good game creators, or just people wanting to share some things, could just post some helpful hints or tips that you learned while making your games.

I haven't acually made a game yet, and was hoping AG could get some more games with your help.

If your having trouble, be sure to check back here for some of the things others have posted.

Thanks to all.

  • 16 Replies
waynaul
offline
waynaul
73 posts
Nomad

I'm still working on my first game, but I thought I'd like to share a rule of thumb that helps me.

If I'm about to add something complicated to my program, something I'm not sure how I'm going to fully implement yet, I will "stub" it. Suppose I have a function that will do complicated calculations and returns a number. I will first have the function simply return the value of one.

public function calculateSomething:Number {
return 1;
}

I'll compile the program and make sure the program fits in with the game. Then I'll make a small change with the function so that it is slightly more toward how I want it to end up being, and I compile again. I keep compiling after every small change to make sure that I always have a working program. If something really strange happens when I run the program, I'll know it is most likely something I recently coded since the previous version worked.

Hope that helps.
-Waynaul

SoulHack117
offline
SoulHack117
1,845 posts
Nomad

I really do wanna make a game, but I am inept when it comes to Code... The most I could do is get on a team, and Write story's...

SwordAndShield
offline
SwordAndShield
567 posts
Nomad

Thanks Waynaul and SoulHack I'm sure when there are some more posts on here at least one will be about code.

Check back soon and please keep posting!

darkshado
offline
darkshado
10 posts
Nomad

I find one of the most useful debugging methods is to simply comment out lines of code until you've found the line that is causing the problem.

Most people probably already new that but oh well.

joeybetz
offline
joeybetz
107 posts
Shepherd

I kind of like this thread. In hopes that is does well, here is my contribution.

A good tip to help prevent memory leaks in your as3 programming is to always create a deconstructor method for your classes. I personally like to create a function called destroy() in most of my classes that will remove children, remove event listeners, and nullify objects. Another way would be to attach an Event.REMOVED_FROM_STAGE listener and put most of your kill code in there.

dank
offline
dank
983 posts
Peasant

Encapsulation
Use it. Though it may take some more time to set up the additional structure, it will be well worth it later on when you need to debug and even reuse your code.

Pre-Planning
You should always think about what it is you are going to do and how you are going to accomplish it. It helps me most when I layout a graphical representation of my code in a UML style.
Example:
http://img4.imageshack.us/img4/773/umlh.jpg

I forgot the others P:

joeybetz
offline
joeybetz
107 posts
Shepherd

Speaking of UML, here is an awesome UML modelling tool that exports actionscript 3 for you based on your diagrams. No package support and code might need some formatting for some, but for larger projects this can save you time.

SwordAndShield
offline
SwordAndShield
567 posts
Nomad

Thanks to all the mods and others who helped with this thread.

Please keep posting! I hope this helps others!

SwordAndShield
offline
SwordAndShield
567 posts
Nomad

Please we need some more posts guys. We have a lot here and thats fantastic but lets get more.

Annihalation
offline
Annihalation
479 posts
Nomad

I learned from the experience I've had as a programmer to make sure your code is organized. A lot of your code can be on the timeline instead of in movie clips.

Also, label your frames. It helps a lot when switching frames (like if you have a flash RPG with a map or inventory screen).

devilkingx
offline
devilkingx
17 posts
Nomad

save often the day you forget to save is probably the day a meoteor falls fron the sky and smashes your computer screen

SwordAndShield
offline
SwordAndShield
567 posts
Nomad

Although the whole meteor is not really that big of a factor but ya I guess that is a really great tip.

SwordAndShield
offline
SwordAndShield
567 posts
Nomad

I am hoping for some more tips. Then we'd have a couple pages and a lot of people checking in for help.

Graham
offline
Graham
8,051 posts
Nomad

always remember to mirror a class file's name with the .java's in the source code.

ex. you open poop.java

// this is poop

public class poop
{
public static void main (String args[])
{
System.out.println("POOP!"
}
}

pheonix3711
offline
pheonix3711
2 posts
Nomad

I use game maker its awesome it comes with destroy instances functions so you dont use up memory

Showing 1-15 of 16