Troops of Deception a mature gaming clan for the battlefield series
 
HomeHomeGalleryFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 a Mad little idea :P

Go down 
AuthorMessage
ShadowScotsman
=T.O.D= Match Organizer
avatar

Posts : 177
Join date : 2009-12-22
Age : 26
Location : Swindon , England

PostSubject: a Mad little idea :P   Wed Jun 23, 2010 3:38 am

i was sat the other night bored and thought about learning how to code a tower defence game in flash, then i thought i could make one based on 2142 or bc2 Razz what do you guys think Razz just thought i'd share my bored moment with yous Razz

_________________
« You can run but you'll die tired »

Back to top Go down
View user profile
noobemata

avatar

Posts : 99
Join date : 2010-05-08
Age : 32
Location : bucharest/romania

PostSubject: Re: a Mad little idea :P   Wed Jun 23, 2010 4:26 am

i actually got to lvl 41 in tower defence Smile
Back to top Go down
View user profile
r3lic222
Admin
avatar

Posts : 318
Join date : 2009-12-03
Location : Aylesbury

PostSubject: Re: a Mad little idea :P   Wed Jun 23, 2010 5:33 am

Sounds like a good idea, ActionScript 3 is all object oriented now so it shouldn't be too difficult, AS2 was awful! Let me know if you need any help, AS3 is very similar to C# semantically so I should be able to give you some pointers. Also I would definitely be available if you need any alpha testing Razz

_________________
Back to top Go down
View user profile http://www.patgaunt.co.uk
noobemata

avatar

Posts : 99
Join date : 2010-05-08
Age : 32
Location : bucharest/romania

PostSubject: Re: a Mad little idea :P   Wed Jun 23, 2010 6:03 am

i meant i played the game and got to lvl 41 lol!
Back to top Go down
View user profile
ShadowScotsman
=T.O.D= Match Organizer
avatar

Posts : 177
Join date : 2009-12-22
Age : 26
Location : Swindon , England

PostSubject: Re: a Mad little idea :P   Wed Jun 23, 2010 1:50 pm

wow lol you know a damn sight more than me then Razz i basicly know nothing about coding Very Happy luckily though i usually pick things up nice and easily, i didnt find html and css to difficult so im hoping this works the same Razz

_________________
« You can run but you'll die tired »

Back to top Go down
View user profile
r3lic222
Admin
avatar

Posts : 318
Join date : 2009-12-03
Location : Aylesbury

PostSubject: Re: a Mad little idea :P   Wed Jun 23, 2010 3:04 pm

Haha, umm, HTML and CSS are the simplest of languages, they aren't object oriented at all, they are a useful starting point though. Actionscript 3 will be very different, you code by making methods and classes etc

With markup languages like HTML you do

[code]< p>Hello< / p >[/code]

To put a title on the page, very simple. With object oriented (OO) languages its very different, you don't affect a page or anything directly, rather you have methods with statements in them, for example in your game you may have a method where a unit has been hit by a tower and you would determine whether the unit dies by doing something like

if(unit.hit)
{
unit.health = unit.health - missile.damage;

if(unit.health =< 0)
{
unit.die;
}
}

This is pseudo code (human readable code) which basically says, if the unit is hit (unit.hit would be a method to determine if it has been hit) then make the units health (unit.health) equal to its current health minus the damage value of the missile (missile.damage). You can then do another if statement checking to see if the units health is equal to or less than 0 and if it is then do the unit.die method, else do nothing.

This is a very small, simple example, in the case that the unit dies part of your unit.die method would be to remove the unit sprite from the game which again is done programatically rather than directly. It's easy when you pick up the basics and in my opinion it is very fun to learn Smile

edit: the HTML has spaces in the tags because the forum can accept HTML so I had to spoof it Razz

_________________
Back to top Go down
View user profile http://www.patgaunt.co.uk
ShadowScotsman
=T.O.D= Match Organizer
avatar

Posts : 177
Join date : 2009-12-22
Age : 26
Location : Swindon , England

PostSubject: Re: a Mad little idea :P   Wed Jun 23, 2010 4:14 pm

yea i understand that bit because it usually does litrually what it says, so its quite easy to read, its when it gets into determineing what unit.die actually does is when i get confused lol

_________________
« You can run but you'll die tired »

Back to top Go down
View user profile
CaptainMagicAA
=T.O.D=
avatar

Posts : 336
Join date : 2010-01-06
Age : 46
Location : Paris, France

PostSubject: Re: a Mad little idea :P   Wed Jun 23, 2010 4:36 pm


you should go in C# forum because it's hard for me to see C# here after a day of working affraid
Back to top Go down
View user profile
r3lic222
Admin
avatar

Posts : 318
Join date : 2009-12-03
Location : Aylesbury

PostSubject: Re: a Mad little idea :P   Thu Jun 24, 2010 3:11 am

haha sorry captain, you have to love a bit of C# though Razz @shadow unit.die would be much the same, as i said, in this very simple example it would simply be a matte of removing the sprite frm the game. In fact to do this properly it would be

unit.Die(unit);

in this case we are passing the current unit to the die method as a parameter, this means that rather than having to find the unit again we already have access to the unit so the unit.die method would be something like this:

private void Die(sprite unit)
{
gameworld.removeSprite(unit);
}

i can't remember the method names in AS3 but there is something like removeSprite, where ganeworld is the name you have given to your game environment. I did quite a lot of actionscript at uni,if you go to www.patgaunt.co.uk you can see some examples; the 2D environment and jukebox are both flash. As i said, i can help if you need it and there are plenty of online tutorials Smile

_________________
Back to top Go down
View user profile http://www.patgaunt.co.uk
Kev
=T.O.D=
avatar

Posts : 292
Join date : 2009-11-24
Age : 44
Location : Shoreham

PostSubject: Re: a Mad little idea :P   Thu Jun 24, 2010 3:53 am

The thing is I know what all those words mean individually but put them together as you have all done above and I haven't got a clue what you are talking about. Lol. It might as well be greek!
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: a Mad little idea :P   

Back to top Go down
 
a Mad little idea :P
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
=T.O.D= :: General :: Off Topic-
Jump to: