Dear Cerberus X User!
As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.
Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.
Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!
Accepting ensures:
- Continued access to your account with a short break for the actual transfer.
- Retention of your data under the same terms.
Without consent:
- You don't have further access to your forum user account.
- Your account and personal data will be deleted after April 5, 2024.
- Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.
We hope to keep you in our community and see you on the forum soon!
All the best
Your Cerberus X Team
If you want to set it at the start of your game, then do it inside OnCreate. If you want to switch it during the game, place it inside OnUpdate.Now I'm trying to work out where do I put SetDeviceWindow.
Strict
Import mojo
Class CGame Extends App
'timer
Field lastTick:Int
Field secs:Int
Field mins:Int
Field hrs:Int
Field dys:Int
'resources
Field wood:Float
Field loopedtimeforwood:Int
'character
Field characters_front:Image
Field characters_back:Image
Field characters_look_left:Image
Field characters_look_right:Image
Field characters_walk_left:Image
Field characters_walk_right:Image
Field x:Float
Field y:Float
Field character:Image
Field p1:CGame
Method OnCreate:Int()
SetUpdateRate(0)
lastTick = Millisecs()
loopedtimeforwood = 0
wood = 0
SetDeviceWindow(1600,1500,1)
'character
character = LoadImage("character_front.png")
SetUpdateRate 60
Return 0
End Method
Method OnUpdate:Int()
Local tick:Int = Millisecs()
If tick>=(lastTick+1000)
lastTick = tick
secs += 1
loopedtimeforwood+=1
Endif
If secs > 59 Then
secs = 0
mins +=1
If mins > 59 Then
mins = 0
hrs +=1
If hrs > 23 Then
hrs = 0
dys += 1
Endif
Endif
Endif
If loopedtimeforwood >= 20
wood+=1
If KeyDown (KEY_A) Then wood+=1
loopedtimeforwood =0
End
If KeyDown (KEY_LEFT) Then x = x - 4
If KeyDown (KEY_RIGHT) Then x = x + 4
If KeyDown (KEY_UP) Then y = y-4
If KeyDown (KEY_DOWN) Then y = y +4
Return 0
End Method
Method OnRender:Int()
Cls 24, 234, 75
DrawText("Mins: "+secs, 200, 200)
DrawText("Min: "+mins, 570, 10)
DrawText("Hour: "+hrs, 510, 10)
DrawText("Day: "+dys, 460, 10)''''''''''''''''
DrawText("Wood: "+wood, 100, 100)
DrawImage character, x, y
Return 0
End Method
End Class
Function Main:Int()
New CGame()
Return 0
End Function
By target d you mean device/operating system? if so im doing windows pc
Well I used Function ExitApp:Int() on all of them and none liked function :/