View Full Version : Simple Game
Mike Halliday
11-28-2007, 09:55 PM
Here is a 'very' simple game idea, a very simple implementation by a very simple programmer! ME.
BLOCKRUNNER - The idea is to manouver your red block for as long as possible by dodging and running from the coloured blocks. Avoid the left, right and bottom borders too as these will also end the game.
Looks and sounds simple, but it can be quite tricky! - I have managed 20 seconds so far - thats it.
Coded and tested in about 2 or so hours (and it shows) - so don't give me grief about how bad it is! ha ha
Try and enjoy it - if you can.
PC only at this stage, and source code to follow;[br]1196286932_671_FT0_blockrunner-x86.zip
PointOfLight
11-28-2007, 10:55 PM
I downloaded and tried to run the game, and unfortunately it won't work for me.* The splash screen comes up, but when I tap the screen to continue I get what basically amounts to an access violation error and the program terminates.
I'd hardly classify you as a "simple programmer".* You've turned out some pretty amazing stuff on this forum.
PointOfLight
11-28-2007, 11:03 PM
Okay, I just tried it on my Windows XP machine (the other one was running Windows 2000), and on XP it runs fine.* This is cool!* I don't know why, but for some reason I really like this type of game.* But 20 seconds?????* I barely made 10 once, and that's about it.* If you ever plan on making any additions / changes to this, I would offer a couple of suggestions:
1. Maybe make the blocks smaller to start with, and grow as the game progresses
2. Make sure the player's box is always under the cursor before the game "starts"
3. Make sure the player is always clear before the game starts.* I lost so many games right away because my block started in a collision with an enemy block.
Other than that, this is a great little example of what PPL can do.
Mike Halliday
11-29-2007, 07:12 AM
Thanks Eric, - I must be a simple programmer as Donone's class example gave me a headache! (Don't understand classes)
Originally I had some code that made the blocks speed up, but it got to the stage where it was so impossible to play, I removed it for initial release.
There is still a low wrong with the game - I dont know if you noticed but sometimes the blocks clump together and move in unison! - That definately needs to be fixed! ROFL.
I thought the red block always started where the cursor was? Hmmm I will have a look at that. Maybe next release will have multi coloured size changing speed changing blocks ... I will see how much time and brain power I can turn to it.
I do know that the code is ver inefficient and needs work too! (Sloppy quick coding)
:D
matteo.m
11-29-2007, 08:44 AM
Hi Mike, i tried under my windows vista and i get the same behavior that POL is having under w2000
Mike Halliday
11-29-2007, 09:01 AM
Hmm - I run it under Vista Home Premium and it works fine. (I have User Access Control enabled too - Wonder if its something to do with that)
Very strange - It is compiled under 1.32 Pro and not a beta.
Mike Halliday
11-29-2007, 09:06 AM
I have just tried the file on a works PC (XP Pro) and it does work.
This does not bode well! I might have a compilation issue - I will try the archive tonight on my wife's Vista laptop and see if it works.
Anyone else had this issue?
kornalius
11-29-2007, 03:24 PM
XP here and it is not running either. When I click the screen to start the game (after the splash screen) I get an access violation. If you'd like to send me the source code, I might be able to tell you exactly were the problem is and if it is a bug in PPL I can fix it! :) support@arianesoft.ca
Donone
11-29-2007, 03:34 PM
Hello Mike, just spotted your comment, I agree with PointOfLight, far from simple programmer. I haven't tried this game yet but will. I will only let on how long I last when I achieve 21 seconds :-)
As a matter of interest I have posted a diagram for the PathSprite Class that may assist you if you are that way inclined.
I wish to heck I understood 3D, so hopefully you will publish in the next newsletter.
[EDIT] Yes I have just played and can say two things...
one it is hellish addictive
two I think your clock is running very very slow :-)
I managed 7 seconds.
Mike Halliday
11-29-2007, 07:50 PM
Thanks Donone. - Wonder why we can play it but the others can't! :S
Have seen your document upload - I wil have a look to see if I can get to grips with classes.
BTW. The clock is calculated via the system TICKS routine so should be 100% accurate! hee hee - You need more practice!!! :D
Alain - I have eMailed the source to you.
Donone
11-29-2007, 08:16 PM
I am working on a simpler example of the construction and use of Classes, (perhaps a couple of days) in case it may be of benefit to people that have not ventured into that area. The PathSprite Class was a little complicated.
I'll keep practicing, I'm using XP pro. PointOfLight got it running and hit 10 seconds. Perhaps his system clock is faster :-)
As for yours, you may well have a variable clock :-):-)
Mike Halliday
11-29-2007, 09:41 PM
I think I may have got that score before I fixed the timer and the enemy movement issues - I can now only get 9 seconds max! ROFL.
How rubbish am I at my own game! hee hee
PointOfLight
11-29-2007, 10:00 PM
I haven't tried it with Mike's game yet, but the trick to this type of game in general is to get a background process running that hits the CPU really hard.* That will slow down the enemy blocks enough to get you a high score :)
Mike Halliday
11-29-2007, 10:12 PM
Oi - Cheat! ROFL!!! ha ha ha
PointOfLight
11-30-2007, 05:04 AM
I just tried it on my box at home (XP SP2), and it fails there as well.* There's a lot of differences between what's installed on all 3 machines, but the one thing definitely common between the two that failed that's missing on the one that worked is PPL.* On my home box and the Windows 2000 box at work I have PPL installed.* The other box has never had anything PPL related on it before.
Mike Halliday
11-30-2007, 07:12 AM
Hmmm - I will try and uninstall PPL on the work machine and see if that makes a difference.
Still not tried it on my wife's vista laptop yet - I finish work early on Fridays so will get the chance to try tonight!
Will post the results later tonioght.
kornalius
11-30-2007, 02:48 PM
I just tried your code Mike and there are quite a few runtime errors. ;) I don't think it is related to the machine per se.
Run your code in the PIDE using Run and not Run Dedicated. In dedicated mode it tries to run as fast as possible it doesn't do any runtime checks.
Mike Halliday
11-30-2007, 02:56 PM
I have run the code in 'Run' and not 'Dedicated run' mode and the only error I got was that the dimensioning of 3 variables was off by 1.
Fixed those and it ran without issue.
(Increased the DIRX variables by an extra 1)
Don't know why others are having issues.
(Tried this on WIN XP today and not Vista)
matteo.m
11-30-2007, 04:13 PM
Is still not working on my windows vista... as soon i press the mouse button after the splash screen it crash. I can read on the bottom you survived 0 sec and that's it. I may suggest to put some debug line to write a log file so i may can help to understand what's wrong.
Mike Halliday
11-30-2007, 05:29 PM
OK...
I have now tried this on my wife's Vista machine and it worked first time. In fact every .EXE that I have made worked immediately with no errors.
Both same versions of VISTA HOME PREMIUM. Both have UAC enabled, both have 1GB ram - My laptop is 2Ghz my wife's is 1.73Ghz.
My wife's laptop does not have PPL installed
Could it be some sort of localisation thing. Both our laptops are set for UK English (across the board). - Maybe this is why Donone is able to run them too! ??
Don't know if this helps any?
kornalius
11-30-2007, 06:49 PM
Have you fixed the Collision grid issue as well? SetCollisionGrid() ? I got a message that it was too small when I ran your code.
Mike Halliday
11-30-2007, 07:34 PM
I have added
SetCollisionGrid(128,128,128);
before the GAMECOLLIDE(True); routine.
This seems to fix this issue with the collision grid.
Alain, when running code from the PIDE is it best to use RUN or DEDICATED RUN?
I have been using DEDICATED RUN ever since starting using PPL :(
Why is it there if it masks potential errors? - What run mode is used when an EXE is made?
kornalius
11-30-2007, 10:37 PM
Executables are ran in the fastest mode possible, which is, dedicated.
Normal run mode will do a lot of runtime checks, not dedicated.
You should always develop with normal run mode and finally test with dedicated for speed.
Mike Halliday
12-03-2007, 07:29 PM
Here is a re-compiled version of BLOCKRUNNER - Hopefully this version will run on other users PC's as well as mine.
I have included all version builds in this archive so you can try it on all your devices.
Expand to a folder on your smartcard or PC and run from there.
Please let me know if you are still having issues running the game.
Thanks
Mike.[br]1196710162_671_FT8117_blockrunner.zip
kornalius
12-04-2007, 12:41 PM
Hi Mike,
Now I get the white screen with the red box in the middle and then it crashes on the PC.
Mike Halliday
12-04-2007, 01:38 PM
Well you are getting further!
I cant quite put my finger on what is wrong.
You are able to run other things I compile and submit.
Maybe there should be a forum thread where we can discuss our development machines and enviroments there in.
This way I can try re-compiling and see which environments work best.
I will try and get my VMware machine up and running with XP PRO installed to see if I get more success with that instead of vista.
Don't understand why I can run this on my DEV machine and my wife's laptop without any issues (and play full games too)! :(
I will keep you all posted.
PointOfLight
12-04-2007, 01:44 PM
Actually, you are getting closer.* I just tried it on my Windows 2000 machine, which previously didn't work, and it runs flawlessly.* I would make one minor suggestion, though.* On the main screen, determine whether you're running WinCE or Windows and change the instructions to say Hit Space To Exit if on Windows.* Really minor, I know, but for those who don't know that the A button on the PPC translates to space on the PC, that would be useful.
Mike Halliday
12-04-2007, 02:08 PM
I will include this detection in my future releases when they are both on PC and PDA. I should really change my text to say "SPACE" when its PC only! :)
Donone
12-07-2007, 02:51 PM
Hello Mike, you might want to try this...
http://members.iinet.net.au/~pontipak/redsquare.html
Mike Halliday
12-07-2007, 03:00 PM
18.86 seconds on that one on my first attempt - huh some sort of genius? I dont' think so, that version is too easy, and is on a bigger screen! rofl!
Donone
12-07-2007, 03:16 PM
Did you have your hat on?
This one was said to test USAF pilots. I believe they must go 20 seconds.
Mike Halliday
12-07-2007, 03:39 PM
Ha ha - nope - I am at work and the hat does not follow me there!
jdixon
06-29-2008, 04:09 AM
hello mike i trying to make first game with PPL, with any language really, I am starting to understand using sprites, using the gameapi for making maps. I do not get how to the next steps after make the maps. I have started writing the for rolling dice, setting for the start of the game but these steps to keep me going until I learn how/what is next I need to do. Here is an example. I built my map the from the mario example. Now what? Are there tutorails that will walk you though the making of game. I have this one idea, yor years, that will not go away. Can you or someone help me? I just want to prove to my self that I could do it.
Mike Halliday
06-29-2008, 06:06 PM
Hi.
Its not that difficult once you get started. Have you looked at the block runner game source to see how its written?
If you want to send me a Private Message with what you want to do I will see if I can give you some pointers and assist you as much as I can.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.