Basic

Les questions relatives aux logiciels en général peuvent être posées ici.
Verrouillé
Antoine
Messages : 157
Enregistré le : 25 mai 2008, 00:11
Localisation : Nantes

Basic

Message par Antoine »

Bonjour a tous
Je cherche un logiciel qui permet d'enregistrer du code Basic ( et non Visual Basic ) en exe
Voici le code :
paddle = GraphicsWindow.AddRectangle(120, 12)
ball = GraphicsWindow.AddEllipse(16, 16)

GraphicsWindow.BackgroundColor ="PaleGreen"
GraphicsWindow.FontSize = 14
GraphicsWindow.MouseMove = OnMouseMove

score = 0
PrintScore()
Sound.PlayBellRingAndWait()

x = 0
y = 0
deltaX = 1
deltaY = 2

RunLoop:
x = x + deltaX
y = y + deltaY

gw = GraphicsWindow.Width
gh = GraphicsWindow.Height
If (x >= gw - 16 Or x <= 0) Then
deltaX = -deltaX
EndIf
If (y <= 0) Then
deltaY = -deltaY
EndIf

padX = GraphicsWindow.GetLeftOfShape(paddle)
If (y = gh - 28 And x >= padX And x <= padX + 120) Then
Sound.PlayClick()
score = score + 10
PrintScore()
deltaY = -deltaY
EndIf

GraphicsWindow.MoveShape(ball, x, y)
Program.Delay(1)

If (y < gh) Then
Goto RunLoop
EndIf

GraphicsWindow.ShowMessage("Game Over ! Your score is: " + score, "Score")

Sub OnMouseMove
paddleX = GraphicsWindow.MouseX
GraphicsWindow.MoveShape(paddle, paddleX - 60, GraphicsWindow.Height - 12)
EndSub

Sub PrintScore
' Clear the score first and then draw the real score text
GraphicsWindow.BrushColor = "SkyBlue"
GraphicsWindow.FillRectangle(10, 10, 200, 20)
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.DrawText(10, 10, "Score: " + score)
EndSub
C'est un petit jeu mais je ne sais pas comment le convertir en .exe

Merci :wink:
Avatar du membre
Henri
Administrateur
Messages : 1188
Enregistré le : 01 mai 2005, 15:09
Localisation : Orvault 44700
Contact :

Re: Basic

Message par Henri »

Bonsoir Antoine,

Il te faut ce que l'on appelle un compilateur.
Il y a longtemps, très, très longtemps j'ai fais quelques programmes en "Qbasic", outil de programmation du temps de MS-Dos ...... que les moins de 20 ans etc ... etc ....
Je ne sais pas si c'est compatible, mais voilà un endroit où tu peux télécharger "QuickBasic", qui est un Compilateur gratuit.
Amuses toi bien, :wink:

http://www.commentcamarche.net/telechar ... quickbasic

Bonne réception, :wink:
Amicalement
Image
Administrateur du Forum
- Intel Core i3 CPU @2.27 Ghz - 4 Go de Ram
- Seven - Windows 10
- Ie11 - Firefox - Opéra - Netscape - Safari
- Windows Defender
- AdAware - SpyBot - Malwarebytes - Glary Utilities
Antoine
Messages : 157
Enregistré le : 25 mai 2008, 00:11
Localisation : Nantes

Re: Basic

Message par Antoine »

Oki, merci

(tu me sauves, encore une fois :lol: )
Verrouillé