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.

DarkBASIC Professional Discussion / - DBPro Coding Challenges -

Author
Message
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 3rd Mar 2006 13:00
This is my attempt to far... You play a rogue traffic cone.



Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 3rd Mar 2006 13:47 Edited at: 3rd Mar 2006 13:50
Soz to double post - this is my next version...

Plot:
You are a Rogue Traffic cone. You must save your companions by flying in using your newly evolved rocket booster and Tractor Beam. You must pick up your buddies and hoist them to safety (safety not implemented yet)... The problem is, once you pick up your buddy, your thrust has twice as much work to do. If you pick him up from too far away then you will get launched into the floor. Pick him up from too close then you will pull away and suddenly launch your buddy into the air!!

Controls:
Left/Right = Rotate your craft
Space = Thrust
Shift = Enable Tractor Beam (Hold to keep it on)


Code:



Screenshot


Attachments

Login to view attachments
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 3rd Mar 2006 15:56
Hehe - that's fun! Really good concept - and nice bit of spring physics too. Will have to restrain myself from nicking the idea!! Not sure how to solve the problem, but if you accidentally drag a fellow cone past the edge of the screen, the cone wraps to the other side, but the tractor beam doesn't - so you go from one second having everything under control to finding the tractor beam stretch the whole width of the screen. I guess a solution would be to use scrolling instead of wrapping.

Untidiest code I've seen from you in a while, Nick - no subroutines, functions -

BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 3rd Mar 2006 17:03
@Nicholas - very interesting concept. While not a lunar lander in theory, because there is no landing involved, at least not yet, it is fun to play. Maybe you land to refuel or something, I'll leave that up to you. I do like what I see so far.

@Everyone - Lunar Lander programs need to land at some point in the game for some reason don't you think?

@Ric - you silly goose, and you said I had an unusual control system in the last challenge. A very different trust system in your version, took a little finess, but can be managed. I look forward to the rest of your game.

To all the rest of you, keep up the good work!
It's great to see all the different ideas!
Matinuker
20
Years of Service
User Offline
Joined: 25th Mar 2004
Location:
Posted: 3rd Mar 2006 19:26
Quote: "i just had to say..Matinuker your lander is the most sexy lookin lander ever:p"


lol

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 3rd Mar 2006 23:19
Newer Version:



BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 4th Mar 2006 02:09
@Zotoaster - looking good so far. Your ship moves too quickly though, but still a lot of tweeking and programming left, just a quick comment for you.


@Everyone - The Lunar Module weighed 32,000 pounds! A large mass to move around, so changes in direction were not speedy. Fighting the great mass with thrusters in a realistic fashion is essential to a good Lunar Lander game.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Mar 2006 02:51
@Ric - I knocked that together quickly after getting up. I did it in between having breakfast and having a shower before embarking upon a 300 mile round trip to pick a mate up and go to a LAN party (where I am now). Dont worry - I'll tidy it up

@BillR: I have plans to make it a kind of lander game... I'm thinking that once you have hoisted your fellow cone to safety you must carefully place them down on pedestals. Maybe make them different heights - higher ones get more points? Or ones further from pickup get more points?! Dunno yet... Maybe when you place one down the points you get are based on how long you were holding it for?

I like the idea of scrolling - nice one Ric!! That certainly gets around the off screen thing... It happened to me and I never really regained control of the cone!

Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 4th Mar 2006 02:53 Edited at: 4th Mar 2006 15:07
Here's mine



Controls are

Arrowkeys - Move around over the moon
Spacebar - Main (and only) thrusters

FunkyStickmen: Battle of the Races (1%)
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Mar 2006 03:23
here is an update on mine, it scrolls now instead...



Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 4th Mar 2006 11:27
@Image All: for some reason, the z-size of your ship is negative. Use 'if Plrdist# <= abs(object size z(Player)/2.0)' in your collision checking and it should work.

Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 4th Mar 2006 15:01 Edited at: 4th Mar 2006 15:44
Negative? o.0 weird. Thnx tho fixed it

Update

Now the module has a camera



/me has a strange pattern of using smileys... O.o

FunkyStickmen: Battle of the Races (1%)
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 4th Mar 2006 15:47
Much better Nic

Can I suggest you keep the cone on screen though? When scrolling the cone is not visible. ie, to far to the left/right.

Also perhaps walls at the ends of the floor. At the moment you can still land in open space beyond the floor putting walls in would stop that.

I like it though the spring physics is cool


Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 4th Mar 2006 16:17
Zotoaster, your game crashes my graphics driver

FunkyStickmen: Battle of the Races (1%)
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Mar 2006 16:40
omg lol

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Mar 2006 16:45
@Zoto - nice work! Few points:
1) On mine, when I respawn, the resolution changes!
2) If I up the res to 1280, 1024 (which my TFT prefers) I get wierdness at the underside of the map, its like an inverse map!

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Mar 2006 16:49
Quote: "On mine, when I respawn, the resolution changes!"

The whole thing, or just for the loading message? cos it does that for me too

Quote: "If I up the res to 1280, 1024 (which my TFT prefers) I get wierdness at the underside of the map, its like an inverse map!"


yeah, probably would... The map only starts of with one squiggly line, and it copies it and keeps pasting it down the way, but it only does it 500 times, so the map'll only be 500 pixels thick, just change the "for y=1 to 500" to "for y=1 to 2000" - though it probably would take longer to load...

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Mar 2006 16:56
It changes the whole things resolutions.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Mar 2006 17:00
That's very odd :S

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Mar 2006 17:49
Better / Newer version:



Matinuker
20
Years of Service
User Offline
Joined: 25th Mar 2004
Location:
Posted: 4th Mar 2006 19:13
One question Zotoaster:

Why are you using arrays to store one
variable?

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 5th Mar 2006 19:40
I dunno, I wanted to make them global, but I'm still a bit used to the dbc way of doing things

I might aswell change that

Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 5th Mar 2006 20:42 Edited at: 5th Mar 2006 20:56
Will it crash me again? ... I guess I'll just have to find out

Edit: Yep, you crashed me



Look what you did to my avatar!!



FunkyStickmen: Battle of the Races (1%)
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 5th Mar 2006 20:59
looks cool

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 5th Mar 2006 21:24
ImageAll: Whats your system setup? Are you using the latest/pretty recent drivers?

Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 5th Mar 2006 22:47
Idk

FunkyStickmen: Battle of the Races (1%)
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 6th Mar 2006 05:50
Lol! Surely you must know SOMETHING about your computer?!

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 7th Mar 2006 01:25 Edited at: 7th Oct 2006 16:49
Two things in this post...
1) I've done a little work on the game. Works quite nicely.. Just need to make a point to it!!
EDIT: Btw, I removed the particles. With particles I get 190fps, without them I get about 2300fps!!! I need a better particle method for the thruster...



2) I've updated my site SLIGHTLY. I have changed the way the forum block gets its data - it now uses AJAX. Although this reduces its compatibility slightly, I'm aiming the site at developers who tend to use the latest and greatest technology anyway! It also has the adavantage of not blocking the page till the webserver has got the RSS from here.
EDIT: This point is now void - I've moved the site into a CMS!

EDIT: Just tried my code on my work machine... It seems no matter what I program, it simply cant do more than 30fps!! At least it works as expected, although the tractor beam sometimes does not line up with the targeted cone... Wierd one, is that!

[center]
Skrawl
18
Years of Service
User Offline
Joined: 7th Mar 2006
Location: Currently Somewhere In Oregon
Posted: 7th Mar 2006 10:58
So heres what I've been working on for the past few days, I just got DBPro about two weeks ago and these coding challenges were just the thing to get me learning what it can do.



The collision is a little wonky, still not exactly sure how it works as well as it does...hehe. I might tweak a few things before the date but who knows.

2+2=5
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 10th Mar 2006 02:30
Wow, it has been quiet in here.

Hope everyone is working hard on their Lunar Lander games.

Learning lots of new things, trying new ideas, getting frustrated, getting excited when something works......yeah, that's what it's all about.

I know I can't enter this challenge since I'm the judge, but I might throw something together anyway, just to share and learn from.

@Nicholas - maybe an option to have either a tow line(more like a pendulum, with no spring action), or tow line with a springy tension like it is now would be nice. At level 1, the tractor beam is so springy it's frustrating.....just my thoughts.
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 10th Mar 2006 07:38
Lol, I ran away

FunkyStickmen: Battle of the Races (1%)
Skrawl
18
Years of Service
User Offline
Joined: 7th Mar 2006
Location: Currently Somewhere In Oregon
Posted: 10th Mar 2006 08:33
Hehe I almost did when I looked at my finished collision math, still confuses me...

2+2=5
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 10th Mar 2006 10:04
@BillR: Yeah I need to tweak that - The problem with a tow line is making it so the line stays a uniform length. I like the springyness - it adds challenge

@Skrawl - welcome to the challenges thread! New blood is always a good thing
You entry is excelent imho. Very Lunar Lander. I love the line art - People who know me on this forum will know I'm telling the truth when I say I'm not a fan of fancy graphics. I believe there is a constant rule which says that a games playability is nearly always inversely proportional to how nice it looks. My evidence for this is that my mate and me played a Commodore 64 game over the internet (using a nift emulator) for about 5 hours. No game released in the last 5-6 years has had that level of attention from me, especially recently.
My advice for your entry - you have used constant values for movement. This probably works great on your machine but remember that your machine is unique - there probably isn't another one identical to it. This means it runs quicker and slower on other peoples machines - it happens to be quicker on mine. Due to this, I never actually managed to safely land the pod. I always hit the ground too hard. You have 2 options:
1) Lock the fps to a max. This means it will only ever run as fast as its meant to or slower. Its also "easier" from a beginers point of view.
2) If you're willing to put in a little more effort and also have some knowledge about how things move based on time and speed is to make the game based on a timer. My entry above yours does this and it means it should run the same speed on anyones machine. It has a little code at the begining of the loop which takes a weighted average of the last frame time and the current average frame time. This is in milliseconds. You can then move things based on units per millisecond (or units per second * 0.001).

Hope this helps

Skrawl
18
Years of Service
User Offline
Joined: 7th Mar 2006
Location: Currently Somewhere In Oregon
Posted: 10th Mar 2006 15:37
@Nicholas: Thanks for your input, what had happened is I was testing collision and dying before I posted that so I had set it to the highest to get it done quicker and forgotten about it. I set it back to a sync rate of 60 and it runs smooth for me, although we'll see what others say.

And now a gift, I give you Lander Remix v2. Now with more line art....and some other goodies I coded in because something told me they needed to be there.



For now this is a final version, but who knows I may wake up at 3am with some crazy notion to add something or other. Now critique away, I await your slings and arrows.

2+2=5
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 10th Mar 2006 16:33 Edited at: 13th Mar 2006 00:34
Well, here's another entry from me - firtly I reverted to the more conventional rotate and thrust control method after Bill's comment about the last one being confusing - and secondly, I thought I'd better include something more interesting with regard to the physics to compete with Nick's spring physics - so I have gone for Newton's law of universal gravitation. Multiple planets - all with there own gravity, and you can fly between them and land on different planets. No game as yet, just a concept.

And before anyone say's it's been done a hundred times before - yes, I'm sure it has, but this is a bit of a result for me because I tried this a while ago and failed - I'm happy to finally get this working using real physics and timer based motion.



Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 10th Mar 2006 16:53
Ooo Rics using real gravity and timer based movement! Time to bring out the big guns boys (and girl(s))!

I just realised that the submission date for this challenge is while I'm on holiday :-(

Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 10th Mar 2006 18:12 Edited at: 10th Mar 2006 18:13
That sucks....Hey, I just got this idea! Maybe I could watch your entry, and take the credit for you!



FunkyStickmen: Battle of the Races (1%)
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 10th Mar 2006 18:36
Well ImageAll - that certainly is an option...

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 10th Mar 2006 19:17
Quote: "Ooo Rics using real gravity and timer based movement! Time to bring out the big guns boys (and girl(s))! "


If I didn't know better I'd say I detected a touch of sarcasm in that comment.

I'm away all this weekend, so that may be it from me - see what time the deadline is on Monday.

Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 10th Mar 2006 19:21
/me must learn the black arts of timer based movement

FunkyStickmen: Battle of the Races (1%)
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 10th Mar 2006 21:16 Edited at: 11th Mar 2006 02:31


- or -





formerly xMik
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 11th Mar 2006 10:08
@xMilk - the problem with using screen fps() for the timer based movement is that for the first second of the game it returns zero. Also it only updates once a second.

BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 11th Mar 2006 11:04
@Everyone - The DEADLINE for Lunar Lander is one Monday at 12:00 Midnight San Francisco Time(PST)Pacific Standard Time. I guesss that's about GMT +8 hours, about 8:00 AM in the UK.

Does that sound OK?
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 11th Mar 2006 17:23
@Nick: I think we may have been bested by Philip, who seems to have found a much simpler and easiar was to solve the array problem. Check out the example here:

http://forum.thegamecreators.com/?m=forum_view&t=73782&b=1

Is there any reason you see to why this super-simple example does NOT work?

I appologise to everyone for sidetracking the discussion, but I felt that our conversation (from two pages ago) needs to be finished!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 12th Mar 2006 10:40 Edited at: 12th Mar 2006 10:43
Okay - some last minute playing around. This is tough, but kind of fun for all of three seconds. No landing as of yet, but you can picture it.

The Controls are

[A] = Left Thruster
[D] = Right Thruster
[M] = Near Thruster
[O] = Far Thruster

And yes, use two hands. Once you spin the thing around, figuring out which thruster is which, well - you are on your own for that one.

Todo list.
1) Make a landing thingy and code for landing.
2) Make the thing easier to play/manuever
3) Get a life
4) Go to bed
5) Almost forget: Post the code.




Open MMORPG: It's your game!
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 12th Mar 2006 11:47
@RiiDii - WOW, tough controls!
I changed your gravity to 1, just to have a fighting chance.
I think controling each thruster independantly, will prove to be too frustrating for players to manage. I would love to SEE 4 independant thrusters firing, but they would certainly have gyro stabilizers in the Lunar Lander to keep the lander from over rotating and getting out of control. Maybe have an gyro assisted mode also if you want to keep this current unassisted flight control system.

Sleep?...there is no sleep for the unfinished Lunar Lander programmers!

I like what I see so far, good luck in finishing it to be more of a game! After you get more of the game programmed, maybe even thrust particles! That would be cool.

@EVERYONE....Visible thrust particles, graphics, rings, whatever, is certainly a plus! Also, remember the Lunar Lander is HEAVY, controls should NOT be instant, you want to feel like the Lander has great mass to overcome with the thrusters.

Keep up the good work, hope everyone has a chance to finish enough to make your version of Lunar Lander fun to play.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 12th Mar 2006 20:51
Okay, after a lot of hard work on the calcs, I finally got it working a lot better. Momentum, gravity, timerbased movement, and most importantly, better gyro stabilizers and particles. Give it a go. Still a little tricky to get used to, but you only really have to control the left and right thrusters. Maybe I'll make levels where later on you will need to use all four thrusters both for manuevering and overcoming gravity. Enjoy.




Open MMORPG: It's your game!
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 12th Mar 2006 23:52
@RiiDii - Much Better control, especially for the starting levels!
I like the particles too. Can't wait for some landing pads to try and crash on!

Everyone, keep working hard, times short!
Remember, sleep is over rated when there is programming to be done!
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 13th Mar 2006 02:24 Edited at: 13th Mar 2006 02:28
Probably all I'll get time for - the aim of the game is now to get the cones to the safety of the tunnel to heaven




Its fairly well commented code - however (sorry Ric) I haven't got it into functions and subroutines

I moved to the control to mouse, mouse axis x to rotate, left click to thrust and right click to tractor beam.

The tractor beam will only engage when within 10 units (so no more tractor beaming from the top of the screen launching the target up and you down). The tractor beam also breaks if a limit of 12 is exceeded. The colour of the beam changes based on tension.

You (and your fellow cones) can also die if you hit the floor too hard.

Screeny attached...

EDIT: Here it is...


EDIT 2: Tweaked code - issue with sliding a cone into the tunnel to heaven...

Attachments

Login to view attachments
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 13th Mar 2006 11:08
@BillR: Is the deadline 8am today or tomorrow (bearing in mind its now 10:10 GMT)...

Login to post a reply

Server time is: 2024-11-24 15:53:59
Your offset time is: 2024-11-24 15:53:59