Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - XanthorXIII

Pages: [1] 2
1
GLBasic - en / Using Prototypes
« on: 2011-Jul-27 »
Hello,
Long time no see ;) I'm thinking about adding Prototypes to my game. The reasoning for this is wanting Callbacks. Am I correct that I can use Prototypes in this manner?
Thanks.

2
Off Topic / Music/Sound Recommendation
« on: 2011-Jun-07 »
Does anyone have a recommendation for Sound/Music Artist? I'm looking for someone that does Electronic/Trance kind of music.

4
Math / Object Counter
« on: 2011-May-20 »
Thought I would share this handy object counter. Essentially it's an Eggtimer that you set and check to see if a specified time period in seconds has been reached. Thanks to MrTAToad for the concept from his AppTimer especially the Pause Function from it that solved a math issue I was having.

You start by creating the object with a given time in seconds using the InitializeTimer function. Then once per update loop you call the UpdateTimer on the object. Then after that you call the CheckTimer when you want to see if the Timer is up. If it is, it will reset itself for the next round. If you want to reset the timer before it hits the time it has been set to without changing that value, call the ResetTimer function. If you want to to change the timer to a new value call
ChangeTimer and pass the seconds you want to change the timer to which also resets the timer at the same time.

By the way if you have a better way of doing this or any suggestions/errors you find, please let me know, I'm open to all possibilities. :)

 

Code: (glbasic) [Select]
TYPE GameObjectTimer

initialTime = 0
deltaTime = 0
countTime = 0
pausedTime = 0
elapsedTime = 0
paused = FALSE

// Initialize the amount of time you want to pass before the trigger
FUNCTION InitializeTimer: countTo
self.initialTime = GETTIMERALL()
self.countTime = countTo
self.paused = FALSE
ENDFUNCTION

// Call once per update loop
FUNCTION UpdateTimer:
IF self.paused = FALSE
self.deltaTime = GETTIMERALL()-self.initialTime
ENDIF
ENDFUNCTION

// Call after the UpdateTimer. This needs to be called or the timer will never reset
FUNCTION CheckTimer:
IF self.paused = FALSE
IF INTEGER(self.deltaTime/1000) >= self.countTime
self.ResetTimer()
RETURN TRUE
ENDIF
ENDIF
ENDFUNCTION

// If you want to reset the timer but keep the orignal value for your check, use this
FUNCTION ResetTimer:

self.initialTime = GETTIMERALL()

ENDFUNCTION

// If you want to change the value that gets checked on, it also calls ResetTimer()
FUNCTION ChangeTimer: startTime

self.countTime = startTime
self.ResetTimer()
ENDFUNCTION

//Call this function when you pause the game passing in TRUE to pause and FALSE to unpause it
FUNCTION PauseTimer: isPaused
IF isPaused
self.pausedTime = GETTIMERALL()
self.paused = TRUE
ELSE
self.elapsedTime = GETTIMERALL()-self.pausedTime
self.initialTime = self.initialTime+self.elapsedTime
self.paused = FALSE
ENDIF

ENDFUNCTION

ENDTYPE


Sample Program

Code: (glbasic) [Select]
LOCAL testTime AS GameObjectTimer
LOCAL pauseTheTime = FALSE
LOCAL PkeyPressed = FALSE
LOCAL UkeyPressed = FALSE

testTime.InitializeTimer(10)

WHILE NOT KEY(01)

IF KEY(25) AND PkeyPressed = FALSE
testTime.PauseTimer(TRUE)
PkeyPressed = TRUE
ENDIF

IF NOT KEY(25)
PkeyPressed = FALSE
ENDIF

IF KEY(22) AND UkeyPressed = FALSE
testTime.PauseTimer(FALSE)
UkeyPressed = TRUE
ENDIF

IF NOT KEY(22)
UkeyPressed = FALSE
ENDIF

testTime.UpdateTimer()
PRINT testTime.deltaTime,10,10
PRINT testTime.initialTime,10,20
PRINT testTime.pausedTime,10,30
testTime.CheckTimer()
SHOWSCREEN
WEND

END

5
GLBasic - en / Game slightly jerky
« on: 2011-May-18 »
So after building the Main portions for my game, I'm running into slight issues where the game is jerky. The main game play starts up fine but after a bit it jerks a little bit and then goes back to being fine. I've implement MrTAToad's AppTimer which I call once per game loop and pass it to whatever needs it to update their movement. If I set the game to LIMITFPS -1, the game doesn't do this, however if I leave it at the default of 60, the game jerks a bit.
Is it also possible that I may have too many function calls?
I don't need specific answers but just some general guidance on what I should probably avoid or try doing different.

6
GLBasic - en / Createscreen/Usescreen Benefit
« on: 2011-May-05 »
Generally I have a semi working game but I'm always looking for ways to improve it. I noticed the Createscreen/Usescreen and while I understand how to use them is there a benefit to using them?
I was almost thinking about something like a Pause Screen or Menus.
Does anyone have some good uses for them?

7
Quick question for those that have been doing this longer than I have, but what is your opinion on using Global for declaring variables. Is it ok in some cases and try not to whenever? Is there a danger to me using them aside from the you may change a value somewhere and not know about it?
Just general thoughts, not looking to start a bar brawl.

8
I'll probably be correct on this but does collision and timer based movement go hand in hand? I'm having a slightly odd problem with collision. I have a large object colliding with smaller objects using ether Box or Sprcoll. I found that while both sometimes works I've noticed that at certain angles when it collides, it goes straight through the object. I wonder if I need to put the timerbased movement into my game to correct this issue.

9
GLBasic - en / PowerVR Compression
« on: 2011-Apr-12 »
I was doing some lookup on this but maybe Kitty and Tru have already looked at this. http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/TechniquesForWorkingWithTextureData/TechniquesForWorkingWithTextureData.html

PowerVR for Graphics. Would this possibly help with the memory usage on the iPhone/iPad cutting down the size of the graphics?

10
Off Topic / Option to send Beer to someone
« on: 2011-Apr-08 »
Crazy Question of the day. Wasn't there an option to send someone a beer on the forums here? I could have sworn I saw that at one point.

11
GLBasic - en / Touch Controls like a Pool Game
« on: 2011-Apr-03 »
Does anyone know of Touch Controls that are like a pool game where you Angle the pool stick around a ball, draw back the pool stick and then when you let go it fires?
I'm trying to work this out and having a little bit of a challenge.
Thanks.

12
GLBasic - en / I'd give my right arm...
« on: 2011-Mar-31 »
for some of the tutorials in the Deutsch section to be translated to English. Sure I could use Google Translate but not all of the information may not be translated  correctly.


13
Does anyone have any code examples of constraining a drag-able object within a boundary?
I'm trying to figure this out and I seem to be running into a logic problem whenever I hit the bounds I've set the object just stays there.

14
GLBasic - en / Device Specific Sections
« on: 2011-Mar-25 »
I'm not sure if this has been discussed before but I think we need device specific sections on the forums.
Such as iPhone/iPod Touch/iPad, WebOS, Android(*cough*) GP32X etc....I'm seeing where some code and examples can be found in different sections on the forum. They really should be unified to a dedicated forum subsection.

15
GLBasic - en / New Version of Xcode
« on: 2011-Mar-09 »
Xcode 4 is out now!
http://developer.apple.com/technologies/tools/whats-new.html
Looks like a good deal. However it runs $4.99 for Non Paying Apple Developers through the Mac Store. It's free for those that already have a developer membership.

Pages: [1] 2