SO...?

Post your coding questions such as 'how to' here.

SO...?

Postby Student » Fri Dec 18, 2009 1:46 pm

Hi everyone! I have a "small problem". I want to do a 2D-game where u could shoot and there would be enemies to shoot (and they would shoot at u too :D ). And of course u would have healthbar and when u get hit, u would lose health (and when health runs out, u would have 2 more lives left). If u can tell me what kind of code i would need for this, i could do rest of what it needs. And early thanks for help or that u have tried to help :D !
I just started coding and already i have made progress... And now it got stuck xD
User avatar
Student
Newcomer
 
Posts: 23
Joined: Fri Dec 18, 2009 1:31 pm

Re: SO...?

Postby Chaosworm » Fri Dec 18, 2009 2:14 pm

You need types, integers and objects.
Sigi on päivitetty viimeeksi 4.8.2010.
Deaf wrote:Kuka on tässä trollamassa

Esa94 wrote:<@Esa94> en mä oo täällä
User avatar
Chaosworm
Guru
 
Posts: 1867
Joined: Tue Aug 28, 2007 1:50 pm
Location: Sulkava

Re: SO...?

Postby Jonez » Fri Dec 18, 2009 3:18 pm

From Learning Center (press f8), see lessons" #11. Kartat 2" (= Maps 2), "#19. Painovoima" (= Gravity) and for bullets lesson "#18. Ammukset 2".

The comments are in finnish but you should be able to understand the code. If you don't know what a certain command does, double click it (or press f1) and the manual opens up. The explanations are in finnish but the comments in the examples are in english, so with patience you should be able to learn the code.

Here are a few commands and functions you should look up (see the example codes, they are in english):
Code: Select all
Repeat ... Forever ... Until    //Starts and ends a loop
DrawScreen                      //Draws the screen

SCREEN                          //Set screen size and type, aka. resolution.

For ... Next                    //For ... Next - loop.
While ... Wend                  //While ... Wend -loop

//For large information handling, like bullets, enemies etc.
Type ... End Type
Dim

//Objects... Very handy for beginners.
LoadObject()
CloneObject()
MoveObject
TranslateObject
PointObject

//Images
LoadImage()
DrawImage()

//Camera commands
MoveCamera
TranslateCamera

//Text commands
Text
AddText

//conditions.
If
Case

//See wiki for functions.
Function

If you don't have any experience in programming, see this wiki article about conditions: Conditional
-Vuoden 2008 aloittelijan ystävä -palkinnon voittaja-
Image <- protestipelikilpailun voittaja.
Space War
User avatar
Jonez
Advanced Member
 
Posts: 417
Joined: Mon Aug 27, 2007 7:37 pm

Re: SO...?

Postby Student » Fri Dec 18, 2009 5:55 pm

Joo Jonez oon kyl suomalaine =D
I just started coding and already i have made progress... And now it got stuck xD
User avatar
Student
Newcomer
 
Posts: 23
Joined: Fri Dec 18, 2009 1:31 pm

Re: SO...?

Postby tuhoojabotti » Fri Dec 18, 2009 6:22 pm

Suomalainen, no miksi ihmeessä sä sitten kirjotat englanninkieliselle alueelle?
dev.tuhoojabotti.com - sinne ne botit menneet on.
Programmer (noun): An organism that turns caffeine into code.
User avatar
tuhoojabotti
Advanced Member
 
Posts: 383
Joined: Tue Aug 28, 2007 2:53 pm
Location: Suomi, Finland

Re: SO...?

Postby Herra Siili » Fri Dec 18, 2009 6:36 pm

Jonez wrote:
Code: Select all
...

//Images
LoadImage()
DrawImage()

...

The command DrawImage doesn't need brackets.
Komento DrawImage ei tarvitse sulkuja.
Chaosworm wrote:Jeesuksella oli aikoinaan viisi leipää ja kaksi kalaa ja Jeesus jakoi niistä riittävästi ruokaa ilmaiseksi tuhansille ihmisille. —— Miksi se olisi tässä tapauksessa eri asia, jos jaan niistä riittävästi leffoja ja pelejä ilmaiseksi tuhansille ihmisille?
User avatar
Herra Siili
Active Member
 
Posts: 232
Joined: Tue Nov 25, 2008 8:06 pm
Location: Viitasaari, Keski-Suomi

Re: SO...?

Postby Chaosworm » Fri Dec 18, 2009 6:40 pm

tuhoojabotti wrote:Suomalainen, no miksi ihmeessä sä sitten kirjotat englanninkieliselle alueelle?

Problems-alue tuli ensimmäisenä vastaan eikä älynnyt sitten kelata alaspäin? Tai toivoi saavansa nopeammin vastauksen alueella, jota käyttävät kaikki?
Sigi on päivitetty viimeeksi 4.8.2010.
Deaf wrote:Kuka on tässä trollamassa

Esa94 wrote:<@Esa94> en mä oo täällä
User avatar
Chaosworm
Guru
 
Posts: 1867
Joined: Tue Aug 28, 2007 1:50 pm
Location: Sulkava

Re: SO...?

Postby Student » Fri Dec 18, 2009 11:22 pm

No kysyin vaan väärästä kohdasta... En huomannu suomen kielistä aluetta
I just started coding and already i have made progress... And now it got stuck xD
User avatar
Student
Newcomer
 
Posts: 23
Joined: Fri Dec 18, 2009 1:31 pm

Re: SO...?

Postby kaneli2000 » Sat Dec 19, 2009 9:28 am

A small offtopic; shall we disgust in English?
Who was ground down in the end. Who was found dead on the phone. Who was dragged down by the stone.
User avatar
kaneli2000
Guru
 
Posts: 1023
Joined: Mon Mar 17, 2008 2:40 pm
Location: Lempäälä

Re: SO...?

Postby Astigma » Sat Dec 19, 2009 11:52 am

kaneli2000 wrote:A small offtopic; shall we disgust in English?

Yes, you should. I think that there was a quite good answer for the original question so I do not see reason why not to lock this topic. The topic title is not acceptable and, as I said, you should speak English only in this area.
CoolBasic henkilökuntaa
Kehityspäällikkö
CoolBasic Classic

----

ImagePark.biz - ilmainen kuvapankki, josta löydät kuvia joka lähtöön
Astigma
General Manager
General Manager
 
Posts: 181
Joined: Sun Aug 26, 2007 4:56 pm
Location: Kuopio, Finland


Return to Problems

Who is online

Users browsing this forum: No registered users and 1 guest