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.

2D All the way! / Help needed. 2D Space invader type game.

Author
Message
Mightmoo
14
Years of Service
User Offline
Joined: 14th Dec 2009
Location:
Posted: 14th Dec 2009 16:06 Edited at: 11th Mar 2010 10:46
Sorry safety reasons
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 15th Dec 2009 21:37
Okay, you have made a few errors in your code. I use DBPro so it is possible that my suggestions may not work (I don't know much about the different command sets between DBC and DBPro).

First of all I don't know what you are trying to do here:

The numbers after the array, are they supposed to be stored inside the array or data outside of the array?

If inside the array then you will need 3 dimentions which can be done easily like this 'dim sheep(1,1,1)'.

If not to be stored in the array, then you could put the command 'data' infront of the numbers and later use the 'read' command to access the stored numbers.

Secondly the 'sprite' command requires 4 numbers not just two. So
'sprite 1, farmerx, farmery, 2' will work as 'sprite 10,6' will not.

Hope this helps

A clever person solves a problem, a wise person avoids it - Albert Einstein
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 15th Dec 2009 22:53 Edited at: 15th Dec 2009 22:55
Yes there are alot of mistakes, perhaps it'll help if you read up the syntax more, click on the statements and press "F1" for help.


I wrote up a quick working example based off your codes that hopfully you'll find usefull, I'm not too good at explaining by words but rather by codes.



An advice to you is to keep your main loop as small as possible, and use alot of subroutines as it'll help you stay organized and be easier to locate codes.
Sherikanman
14
Years of Service
User Offline
Joined: 3rd Dec 2009
Location:
Posted: 17th Dec 2009 06:10
Wow. i copied that last post's code...and i see what you are trying to do! that's really cool! now all you need is to have the collisions react to a score system.

~~~ Insert witty signature here~~~
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 17th Dec 2009 14:55
A hint on displaying the score, use string and manipulate it. Would be a good time to learn the mid$, left$ and right$ statements.

Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Dec 2009 10:39 Edited at: 26th Dec 2009 10:40
DBP had a space invaders challenge a few years ago.

Here's mine with source:
http://dbchallenge.com/?page=games


> SELECT * FROM users WHERE clue > 0
> 0 rows returned
Mightmoo
14
Years of Service
User Offline
Joined: 14th Dec 2009
Location:
Posted: 11th Mar 2010 10:51
Hi im having problems removing my sprites when someone loses a life or completes the game and tries to play again without exiting the game.

Ive tried to use a varible to increase the sprite number when someone dies/loses a life because when i reuse the same sprite number it refuses to move.

Thanks for any help

Login to post a reply

Server time is: 2024-03-28 08:48:12
Your offset time is: 2024-03-28 08:48:12