Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / i'm the most biggest noob ever i need help!!

Author
Message
The Core
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: mother ship
Posted: 13th Feb 2006 14:21
yup i'm a big noob and i need help.

i am in the making of my first game that is 2d with sprite's i have made the enemy follow the player around the screen and all i want to do is make a bullet ( anything will do ) to shoot from my player and if it hits the enemys it kills them. i dont know were to start and i'm having a big problem also whats this ( integer value )

here is a pic of my game dont laugh to much plz help me

i'm E.T i have so much tech but yet i dont have a mobile phone! where is a land line when you need one

Attachments

Login to view attachments
UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 13th Feb 2006 14:33
Good Grief! You are not THAT much of a noob. At least you can use sprites and more them!

Can you post your code. It would make it alot easier for me, but you will probably get some responses from other people even if you don't post it.


Hippopotomonstrosesquippedaliophobia-Fear of long words
The Core
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: mother ship
Posted: 13th Feb 2006 14:39
ok kool here is my code hope u can help i realy need it

sorry not sure how to use the snippet to place the code but here is my code thanx so much and i hopeu can help me

thegame:

sync on

sync rate 30

delete object 1
delete object 2

hide mouse


load image "virus.jpg",3
Load image "alone.jpg",4
load image "lazer.jpg",8

Load image "target.jpg",1
Sprite 6,Screen Width()/2-16,Screen Height()/2-16,1 ; Hide Sprite 6
Make Object Box 6,1,1,1
Position Object 6,Screen Width()/2,Screen Height()/2,0


stop music 2

load music "full reflex.wav",3
load sound "hit2.wav",4

play music 3
loop music 3


load image "space.jpg",5

MAKE OBJECT cube 1,100
scale object 1,10,10,10
texture object 1,2
set object specular 1,2
set object cull 1,0
set object light 1,0
ghost object on 1
set cube mapping on 1,1,2,3,4,5,6
set object ambience 1,0

`the varibles
x=100
y=100
x1=550
y1=400
x2=550
y2=400
x2=550
y2=400
x10=100
y10=100
s=4


DO

YROTATE OBJECT 1,OBJECT ANGLE Y(1)+0.1

REM MOVEMENT OF TARGETER

Position Camera cPx#,cPy#,cPz#
Position Object 6,crPx#+mousemovex()*ms#,crPy#+mousemovey()*ms#,0
Paste Sprite 6,crPx#,crPy#
cPx#=Camera Position x() ; cPy#=Camera Position y() ; cPz#=Camera Position z()
crPx#=Object Position x(6) ; crPy#=Object Position y(6)
ms# = 0.6


`player

sprite 2,x,y,4

`enemy
sprite 3,x1,y1,3
sprite 4,x2,y2,3
sprite 5,x3,y3,3
sprite 7,x4,y4,3


`see if they are touching

if x=x1 and y=y1 then play sound 4
if x=x2 and y=y2 then play sound 4
if x=x3 and y=y3 then play sound 4
if x=x4 and y=y4 then play sound 4

`player controls
if c=0
if upkey()=1 then s=1
if downkey()=1 then s=2
if leftkey()=1 then s=3
if rightkey()=1 then s=4
endif
if s=1 then inc y,-8
if s=2 then inc y,8
if s=3 then inc x,-8
if s=4 then inc x,8

`enemy controls

if x > x1 then inc x1,4
if x < x1 then dec x1,4
if y > y1 then inc y1,4
if y < y1 then dec y1,4

if x > x2 then inc x2,2
if x < x2 then dec x2,2
if y > y2 then inc y2,2
if y < y2 then dec y2,2

if x > x3 then inc x3,5
if x < x3 then dec x3,5
if y > y3 then inc y3,5
if y < y3 then dec y3,5

if x > x4 then inc x4,6
if x < x4 then dec x4,6
if y > y4 then inc y4,6
if y < y4 then dec y4,6

sync

loop

plz help

i'm E.T i have so much tech but yet i dont have a mobile phone! where is a land line when you need one
Computer Nerd
19
Years of Service
User Offline
Joined: 25th Jan 2005
Location: What do you care?
Posted: 13th Feb 2006 15:01
can't help you there it's DarkBASIC pro code I have classic. That's advanced coding your not a noob at all pal.

Need Tutorials? New to DarkBASIC? - http://jonsdbpage.tripod.com
The Core
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: mother ship
Posted: 13th Feb 2006 15:08
thanx i feel like it tho since i carn't get this sprite collisional to work and i've tryed for 2 days solid i just need a little guidance hope someone out there can help

i'm E.T i have so much tech but yet i dont have a mobile phone! where is a land line when you need one
Programmer of Power
19
Years of Service
User Offline
Joined: 22nd Aug 2005
Location: Home
Posted: 13th Feb 2006 15:22
Well, make a bullet sprite first and a fired variable. Hide the sprite. Then, if you want the spacebar to shoot, say



that will set it up for shooting. Then move the sprite to the player's position, using vars to represent the sprites x and y. Then rotate it so it's facing the same way as the character and use the move sprite command.

To check for collision, just see if the sprite's X and Y Coords are the same as the enemy's X and Y coords.

"I will work harder... if you ask me enough times."
The Core
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: mother ship
Posted: 13th Feb 2006 15:28
thanx ile give it a blast later cheers

i'm E.T i have so much tech but yet i dont have a mobile phone! where is a land line when you need one
The Core
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: mother ship
Posted: 13th Feb 2006 20:49 Edited at: 13th Feb 2006 20:50
ok i did this but for some reason its not working its just a tester at the mo but can anyone answer the reason why its not deleting the enemys plz here is the code

`bullet

sprite 8,x9,y9,8

if spacekey()=1 and fired=0 then move sprite 8,20

`enemy

sprite 3,x1,y1,3
sprite 4,x2,y2,3
sprite 5,x3,y3,3
sprite 7,x4,y4,3

`see if they are touching

if x9=x1 and y9=y1 then delete sprite 3
if x9=x2 and y9=y2 then delete sprite 4
if x9=x3 and y9=y3 then delete sprite 5
if x9=x4 and y9=y4 then delete sprite 7

if x9=x1 and y9=y1 then play sound 4
if x9=x2 and y9=y2 then play sound 4
if x9=x3 and y9=y3 then play sound 4
if x9=x4 and y9=y4 then play sound 4

much ablidged if u can help me they are within a loop will this effect anything ummm maybe because of the loop the sprites are respawing can anyone answer plz

i'm E.T i have so much tech but yet i dont have a mobile phone! where is a land line when you need one
The Core
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: mother ship
Posted: 13th Feb 2006 20:56
ok i just did a gosub command for the virus to be deleted outide my loop but obviously it ends my game because its a follow on subrouteine so i have this can anyone help correct me

thegame:

sync on

sync rate 30

delete object 1
delete object 2

hide mouse


load image "virus.jpg",3
Load image "alone.jpg",4
load image "lazer.jpg",8

Load image "target.jpg",1
Sprite 6,Screen Width()/2-16,Screen Height()/2-16,1 ; Hide Sprite 6
Make Object Box 6,1,1,1
Position Object 6,Screen Width()/2,Screen Height()/2,0


stop music 2

load music "full reflex.wav",3
load sound "hit2.wav",4

play music 3
loop music 3


load image "space.jpg",5

MAKE OBJECT cube 1,100
scale object 1,10,10,10
texture object 1,2
set object specular 1,2
set object cull 1,0
set object light 1,0
ghost object on 1
set cube mapping on 1,1,2,3,4,5,6
set object ambience 1,0

`the varibles
x=100
y=100
x1=550
y1=400
x2=550
y2=400
x2=550
y2=400
x10=100
y10=100
s=4
x9=200
y9=200

sprite 8,x9,y9,8

DO

YROTATE OBJECT 1,OBJECT ANGLE Y(1)+0.1

REM MOVEMENT OF TARGETER

Position Camera cPx#,cPy#,cPz#
Position Object 6,crPx#+mousemovex()*ms#,crPy#+mousemovey()*ms#,0
Paste Sprite 6,crPx#,crPy#
cPx#=Camera Position x() ; cPy#=Camera Position y() ; cPz#=Camera Position z()
crPx#=Object Position x(6) ; crPy#=Object Position y(6)
ms# = 0.6


`player

sprite 2,x,y,4
sprite 8,x9,y9,8

if spacekey()=1 and fired=0 then move sprite 8,20



`enemy
sprite 3,x1,y1,3
sprite 4,x2,y2,3
sprite 5,x3,y3,3
sprite 7,x4,y4,3


`see if they are touching

if x=x1 and y=y1 then play sound 4
if x=x2 and y=y2 then play sound 4
if x=x3 and y=y3 then play sound 4
if x=x4 and y=y4 then play sound 4

if x9=x1 and y9=y1 then gosub viruskill
if x9=x2 and y9=y2 then gosub viruskill
if x9=x3 and y9=y3 then gosub viruskill
if x9=x4 and y9=y4 then gosub viruskill

if x9=x1 and y9=y1 then play sound 4
if x9=x2 and y9=y2 then play sound 4
if x9=x3 and y9=y3 then play sound 4
if x9=x4 and y9=y4 then play sound 4

`player controls
if c=0
if upkey()=1 then s=1
if downkey()=1 then s=2
if leftkey()=1 then s=3
if rightkey()=1 then s=4
endif
if s=1 then inc y,-8
if s=2 then inc y,8
if s=3 then inc x,-8
if s=4 then inc x,8

`enemy controls

if x > x1 then inc x1,4
if x < x1 then dec x1,4
if y > y1 then inc y1,4
if y < y1 then dec y1,4

if x > x2 then inc x2,2
if x < x2 then dec x2,2
if y > y2 then inc y2,2
if y < y2 then dec y2,2

if x > x3 then inc x3,5
if x < x3 then dec x3,5
if y > y3 then inc y3,5
if y < y3 then dec y3,5

if x > x4 then inc x4,6
if x < x4 then dec x4,6
if y > y4 then inc y4,6
if y < y4 then dec y4,6

sync

loop

viruskill:

delete sprite 3
delete sprite 4
delete sprite 5
delete sprite 7

not sure what to do at this stage snce the loop has been broken after a sprite is killed can anyone lend a hand.?

i'm E.T i have so much tech but yet i dont have a mobile phone! where is a land line when you need one
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 14th Feb 2006 01:39
Use the [ code ] brackets :S

Pirates of Port Royale:
http://www.popr.gwgaming.net (Temporarily Disabled, We Apologize for the Inconvenience)
Live the life.
The Core
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: mother ship
Posted: 14th Feb 2006 01:42
it dont matter the problem is solved sorted it myself

i'm E.T i have so much tech but yet i dont have a mobile phone! where is a land line when you need one
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 14th Feb 2006 11:46
code breakes (just skip the spaces): [ code ] code here! [ /code ]

like this:

Login to post a reply

Server time is: 2024-11-27 06:50:11
Your offset time is: 2024-11-27 06:50:11