Results 1 to 19 of 19
[Release] Turn!it
This is a discussion on [Release] Turn!it within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Hey guys, maybe you wanna try out my new game called "Turn!t" (Pronounced: Turn It ) About the game: First ...
-
08-09-2009, 02:21 PM #1QJ Gamer Blue
Achievements:
- Join Date
- Jul 2009
- Location
- Germany
- Posts
- 22
- QJ Pts
- 2,319
- Level
- 29
- Downloads
- 0
- Uploads
- 0
[Release] Turn!it
Hey guys,
maybe you wanna try out my new game called "Turn!t" (Pronounced: Turn It
)
About the game:
First of all, this is open source, so you can mod/ expand/ destroy it at your will. The goal of the game is simple as this: Don't lose
On the screen there's a picture rotating all the time. Your task is, to turn your PSP to keep the picture horizontally. Because only then you can read the "hidden" hint telling you what button to press in order to proceed and to not get a "Fail". You just have one second to press the right button, otherwise you get the already mentioned fail. After 5 fails you are game over. Who's straining himself a bit is able to read the hint though without turning the PSP, but that's not the real sense, is it ;)
Additional info:
I created this game just as an exemplar explaining the task for some coding contest i made on www dot pspking dot de
so this game was never really ment to be completely perfect!
Download here:
www dot mediafire dot com / download dot php ? eexmyyymtyv
-
08-09-2009, 02:24 PM #2Lua guy
- Join Date
- Jan 2008
- Location
- Wales, cardiff
- Posts
- 1,442
- QJ Pts
- 11,690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
-
08-09-2009, 03:49 PM #3
wow
cool
this is pretty creative!
Thank you
-
08-10-2009, 05:41 AM #4QJ Gamer Gold

- Join Date
- Nov 2008
- Location
- CAD
- Posts
- 693
- QJ Pts
- 13,372
- Level
- 75
- Downloads
- 19
- Uploads
- 4
Maybe some screenshots ?
That epic dude.
-
08-10-2009, 09:45 AM #5QJ Gamer Blue
Achievements:
- Join Date
- Jul 2009
- Location
- Germany
- Posts
- 22
- QJ Pts
- 2,319
- Level
- 29
- Downloads
- 0
- Uploads
- 0
Sry, i cant post any screenshots:
To be able to post links or images your post count must be 10 or greater. You currently have 5 posts.
Please remove links from your message, then you will be able to submit your post.
this sucks...
-
08-10-2009, 10:46 AM #6
great game man, keep up the good work!
-
08-10-2009, 04:06 PM #7



I think it's a well done game, but the picture spins a bit too fast, you can't read the Button clearly.
-
08-10-2009, 06:02 PM #8QJ Gamer Blue
Achievements:
- Join Date
- Jul 2009
- Location
- Germany
- Posts
- 22
- QJ Pts
- 2,319
- Level
- 29
- Downloads
- 0
- Uploads
- 0
thank you all, and thanks dreiundachzig for posting the screenshots ;)
---
EDIT:
Ok, just finished doing some minor performance improvements, designing the eboot and lowering the rotation speed a little
so there you go: version 1.1
www DOT mediafire DOT com / ?jqmky0nbwnd
Might be too easy now, but you can simply adjust the rotation speed in the code on line 71 where it says:
"bg_rotation = bg_rotation + 0.025"
the number at the end is the speed. in version 1.0 this was 0.05
so 0.05 is fast and 0.025 is slow. you will have to figure it out on your own which speed is best for you.Last edited by Preyker; 08-10-2009 at 06:26 PM.
-
08-11-2009, 02:05 AM #9QJ Gamer Bronze
- Join Date
- Nov 2006
- Posts
- 57
- QJ Pts
- 6,204
- Level
- 51
- Downloads
- 0
- Uploads
- 0
-
08-11-2009, 03:29 AM #10Developer and Tutor.
- Join Date
- Jul 2007
- Location
- Widnes, England
- Posts
- 1,649
- QJ Pts
- 8,736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
you could implement a menu that allows you to change this difficulty in the game, for example easy, medium, hard and insane.
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
08-12-2009, 10:11 AM #11
I've never used PGE but I'm very experienced with Lua (see TruFlow, TruPhoto, Let's Roll!, etc). I'm going to suggest some optimizations seeing as PGE was based off Lua and looks very easy to understand.
First off, take a look at this block of code which seems to be repeated 8 times for each button.
Now, the only difference I see in each of these blocks is 'keynumber' variable, the picture being drawn, and the button to be detected.Code:if keynumber == 1 then timetopress = timetopress + 1 links:activate() links:draweasy(x, 0, bg_rotation) if timetopress <= 100 and pge.controls.pressed(PGE_CTRL_LEFT) then keynumber = pge.math.randint(1, 8) keynumber = pge.math.randint(1, 8) timetopress = 0 end if timetopress > 100 then mis_score = mis_score + 1 keynumber = pge.math.randint(1, 8) keynumber = pge.math.randint(1, 8) timetopress = 0 end end
The first thing I see you can do, seeing as 'keynumber' is always defined and always 1-8, is moveoutside the block, so you only need one. You can actually do the same withCode:timetopress = timetopress + 1
seeing as it has no key specific code. Another thing I was curious about is why you have it get a random number twice. Was once not sufficient?Code:if timetopress > 100 then mis_score = mis_score + 1 keynumber = pge.math.randint(1, 8) keynumber = pge.math.randint(1, 8) timetopress = 0 end
Another thing I noticed was that you have a picture for each button. Not only does this consume memory and add clutter, but seeing as you are already using fonts, a quick modification would clean up the code as well. I'm not familiar with PGE's limitations, but as long as you can print font to a picture, then this should work fine. The idea is to create two images rather than nine. One is the original background, then the second will be modified throughout the game to display different buttons.
Start by loading your background as usual. Then create a new function which will render the other images as needed. It works by first making a copy of the original background, generating a new 'keynumber', then drawing the text on the image based on 'keynumber'. You also can reset your timer here as you always reset it when loading a new button. Here's an idea of what it would look like.Then, whenever you needed a new 'keynumber', rather than callingCode:function newbutton() buttonpic = backgpic timetopress = 0 keynumber = pge.math.randint(1, 8) if keynumber = 1 then --print text to buttonpic end if keynumber = 2 --etc etc end
just call 'newbutton()'. In addition, you do not need to print the background and button image separately now, just changeCode:keynumber = pge.math.randint(1, 8)
toCode:backgpic:activate() backgpic:draweasy(x, 0, bg_rotation)
This also allows you to remove all instances of individual button pictures and renderings.Code:buttonpic:activate() buttonpic:draweasy(x, 0, bg_rotation)
Because of this, the only thing left inside your 'keynumber' blocks of code should beYou can rearrange this, but it is by no means necessary. One move is to combine the two if statementsCode:if keynumber == 1 then if timetopress <= 100 and pge.controls.pressed(PGE_CTRL_LEFT) then newbutton() end end
and then put all of the 'keynumber' blocks insideCode:if keynumber == 1 and pge.controls.pressed(PGE_CTRL_LEFT) then
Instead of setting it up with a series of 'if's, you could casade 'if' 'elseif' ... 'else'. This would easily allow you to add a function in the case that the user pushes the wrong button, say play a sound or add a fail.Code:if timetopress <= 100
Finally, a couple small optimizationscould be simplified toCode:verdana18:print(350, 5, green, "Fails: ") verdana18:print(400, 5, green, mis_score) verdana18:print(420, 5, green, "/5")
making use of string concatenation.Code:verdana18:print(350, 5, green, "Fails: "..mis_score.."/5")
In functions start() and gameover(),should be moved to directly after the draw, so that they are written before another function can be called. Similar situation withCode:pge.gfx.enddrawing() pge.gfx.swapbuffers()
in game(), you should move that to the end of the function, past the drawing code. And you only need one delay, perhaps 'pge.delay(2000000)' would work? That seems like a long time, is delay not in milliseconds anymore?Code:if mis_score >= 5 then pge.delay(1000000) pge.delay(1000000) gameover() end
Another issue exists, but I won't go into it too much as it would require a bigger fix. You call functions from functions, never ending the first, so eventually you could end up running with something to the effect ofAnd that's only after two complete games. Imagine if someone were playing for hours, the PSP's memory would be filled to the brim. I can help you fix this problem as well, but I going to take a break. If you would like any help, as you can see, I am more than happy to provide my advice at no additional charge. :icon_biggCode:start(game(gameover(start(game(gameover())))))
-
08-12-2009, 10:25 AM #12QJ Gamer Blue
Achievements:
- Join Date
- Jul 2009
- Location
- Germany
- Posts
- 22
- QJ Pts
- 2,319
- Level
- 29
- Downloads
- 0
- Uploads
- 0
Yh, i see, the code could be way smaller, you're right, thanks.
So what I yet didnt know: you have to end functions manually? i always thought, just calling another would override the current one and thats it...
so pls tell me how to end functions. this could also be the reason why my new game i'm currently working on always chrashes after a few functions.
-
08-12-2009, 11:49 AM #13
You don't need to end them manually. Once they reach the last 'end' the function stops running. What you did in this script was call another function inside of another. If you let the function end first, then call the next function, it will prevent them from stacking up.
For instance, I will show you how you can fix this in this script. Right now you have:which jumps toCode:while pge.running() do start() end
which jumps toCode:function start() while pge.running() do --code game() --code end end
which jumps toCode:function game() while pge.running() do --code gameover() --code end end
Catch my drift? Since you know you will always loop start() then game() then gameover(), you can just break; out of each while loop, subsequently ending the function. The new code would resembleCode:function gameover() while pge.running() do --code start() --code end end
It all has to do with program flow, so each program may have a different solution. If would like my help and don't want to discuss it out in the open, just PM me.Code:function start() while pge.running() do --code break --code end end function game() while pge.running() do --code break --code end end function gameover() while pge.running() do --code break --code end end while pge.running() do start() game() gameover() end
-
08-12-2009, 06:22 PM #14
Cool Da_MerV made his return.
Currently open for Testing. PM me. QJ letter limit is retarded.
-
08-13-2009, 05:03 AM #15QJ Gamer Blue
Achievements:
- Join Date
- Jul 2009
- Location
- Germany
- Posts
- 22
- QJ Pts
- 2,319
- Level
- 29
- Downloads
- 0
- Uploads
- 0
Thx a lot Da_MerV ! How could i forget the "break"... when i started programming in pge i actually even used the "break" var very often. dunno how i got to forget this nice little word...
However i talked to Bumuckl (do u now him in the us?) as well and told me something like this, which i find impressive to get on this idea:
Nice, huh? That would never have occurred to me... and this should work as well, shouldnt it?Code:-- An example: whichfunction = 1 function 1() do this... do that... ... if pge.controls.pressed(PGE_CTRL_CROSS) then whichfunction = 2 end end function whatever() do this again... and that again... ... if pge.controls.pressed(PGE_CTRL_CROSS) then whichfunction = 1 end end while pge.running() do if whichfunction == 1 then 1() elseif whichfunction == 2 then whatever() end end
-
08-13-2009, 08:54 AM #16
- Join Date
- Dec 2007
- Location
- Toronto
- Posts
- 0
- QJ Pts
- 7,208
- Level
- 56
- Downloads
- 0
- Uploads
- 0
Looks nice is this your first game?
-
08-13-2009, 04:26 PM #17
This is a method I have used before. However, I try to avoid this as its 'messy'. I guess its more of a matter of preference. As I said, its program flow, so it should be taken on a case by case basis. The method I described is indeed the most efficient seeing as you know ahead of time which functions will be called and in what order.
I'm sorry but I'm not familiar with the user "Bumuckl". The US has approximately 300 million people, its a stretch that I would have run into him. I have seen some of his work however, and I can see he is a dedicated worker and is on his way to programming expertise.
-
08-13-2009, 07:15 PM #18QJ Gamer Blue
Achievements:
- Join Date
- Jul 2009
- Location
- Germany
- Posts
- 22
- QJ Pts
- 2,319
- Level
- 29
- Downloads
- 0
- Uploads
- 0
@nick48:
nope, i did "psp copter" before
@Da_MerV:
thx, but there's one more thing confusing me in your code:
doesnt this call all functions at once? i only want one function to be ran at a time...Code:while pge.running() do start() game() gameover() end
-
08-13-2009, 08:22 PM #19
No, Lua, like most programming languages, is linear. It finishes each command successively so it will not start game() until it finishes with start() and gameover() won't run until game() returns.


LinkBack URL
About LinkBacks
Reply With Quote



Hello all members here at QuickJump Gaming Network. How are you all doing?
Hi Everyone